summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy19
1 files changed, 16 insertions, 3 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 635896c2ab2..6a4f13940a7 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -522,7 +522,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%type <num>
type int_type real_type order_dir opt_field_spec set_option lock_option
udf_type if_exists opt_local opt_table_options table_options
- table_option opt_if_not_exists
+ table_option opt_if_not_exists opt_var_type
%type <ulong_num>
ULONG_NUM raid_types merge_insert_types
@@ -2630,8 +2630,15 @@ show_param:
{ Lex->sql_command= SQLCOM_SHOW_STATUS; }
| opt_full PROCESSLIST_SYM
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
- | VARIABLES wild
- { Lex->sql_command= SQLCOM_SHOW_VARIABLES; }
+ | opt_var_type VARIABLES wild
+ {
+ THD *thd= current_thd;
+ thd->lex.sql_command= SQLCOM_SHOW_VARIABLES;
+ if ($1)
+ thd->lex.variable_values= &thd->variables;
+ else
+ thd->lex.variable_values= &global_system_variables;
+ }
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; }
| GRANTS FOR_SYM user
@@ -2668,6 +2675,12 @@ opt_full:
/* empty */ { Lex->verbose=0; }
| FULL { Lex->verbose=1; };
+opt_var_type:
+ /* empty */ { $$=1; /* local variable */ }
+ | LOCAL_SYM { $$=1; }
+ | GLOBAL_SYM { $$=0; }
+ ;
+
from_or_in:
FROM
| IN_SYM;