Index: sql/sql_yacc.yy =================================================================== --- sql/sql_yacc.yy (revision 1) +++ sql/sql_yacc.yy (working copy) @@ -14489,10 +14489,11 @@ ; opt_var_type: - /* empty */ { $$=OPT_SESSION; } + /* empty */ { $$=OPT_ALL; } | GLOBAL_SYM { $$=OPT_GLOBAL; } | LOCAL_SYM { $$=OPT_SESSION; } | SESSION_SYM { $$=OPT_SESSION; } + | ALL { $$=OPT_ALL;} ; opt_var_ident_type: Index: sql/sql_show.cc =================================================================== --- sql/sql_show.cc (revision 1) +++ sql/sql_show.cc (working copy) @@ -6439,13 +6439,15 @@ const char *wild= lex->wild ? lex->wild->ptr() : NullS; enum enum_schema_tables schema_table_idx= get_schema_table_idx(tables->schema_table); - enum enum_var_type option_type= OPT_SESSION; + enum enum_var_type option_type= OPT_ALL; bool upper_case_names= (schema_table_idx != SCH_VARIABLES); bool sorted_vars= (schema_table_idx == SCH_VARIABLES); if (lex->option_type == OPT_GLOBAL || schema_table_idx == SCH_GLOBAL_VARIABLES) option_type= OPT_GLOBAL; + if (lex->option_type == OPT_SESSION) + option_type= OPT_SESSION; mysql_rwlock_rdlock(&LOCK_system_variables_hash); res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars, option_type), Index: sql/sql_priv.h =================================================================== --- sql/sql_priv.h (revision 1) +++ sql/sql_priv.h (working copy) @@ -317,7 +317,7 @@ enum enum_var_type { - OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL + OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL, OPT_ALL }; class sys_var; Index: sql/set_var.cc =================================================================== --- sql/set_var.cc (revision 1) +++ sql/set_var.cc (working copy) @@ -481,7 +481,7 @@ sys_var *var= (sys_var*) my_hash_element(&system_variable_hash, i); // don't show session-only variables in SHOW GLOBAL VARIABLES - if (type == OPT_GLOBAL && var->check_type(type)) + if (type != OPT_ALL && var->check_type(type)) continue; /* don't show non-visible variables */