From c2bd7f78a523759d23827d394a2e09005e013e1d Mon Sep 17 00:00:00 2001 From: riseuplzy Date: Wed, 19 Jul 2023 10:34:13 +0800 Subject: [PATCH] fix(tianmu): refactor the yacc file for #1359 --- sql/sql_yacc.yy | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 32016b742..1c519999d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -465,7 +465,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, YYLTYPE **c, ulong *yystacksize); Currently there are 159 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 155 +%expect 158 /* Comments for TOKENS. @@ -1373,6 +1373,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, YYLTYPE **c, ulong *yystacksize); definer_opt no_definer definer get_diagnostics alter_user_command password_expire group_replication + opt_layer_spec + END_OF_INPUT %type call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt @@ -12219,21 +12221,10 @@ show_param: ; show_engine_param: - STATUS_SYM + opt_layer_spec STATUS_SYM { Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS; } - | layer_ident STATUS_SYM - { - Lex->create_info.layer_name = to_lex_cstring($1); - Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS; - } - - | layer_ident table_list STATUS_SYM - { - Lex->create_info.layer_name = to_lex_cstring($1); - Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS; - } | MUTEX_SYM { Lex->sql_command= SQLCOM_SHOW_ENGINE_MUTEX; } @@ -12241,6 +12232,16 @@ show_engine_param: { Lex->sql_command= SQLCOM_SHOW_ENGINE_LOGS; } ; +opt_layer_spec: + /*empty*/{} + | layer_ident opt_table_list + { + Lex->create_info.layer_name = to_lex_cstring($1); + /* + 'opt_table_list' injects the full table name automatically + */ + } + layer_ident: