diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index e3fbb830df5..bda6bddb7de 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -415,3 +415,8 @@ ALTER TABLE t2 DROP c; UNLOCK TABLES; DROP VIEW v1; DROP TABLE t1, t2; +# +# KILL QUERY ID USER +# +kill query id user 'foo'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''foo'' at line 1 diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 78de8a784f3..6eb9d55f9b8 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -663,3 +663,9 @@ ALTER TABLE t2 DROP c; UNLOCK TABLES; DROP VIEW v1; DROP TABLE t1, t2; + +--echo # +--echo # KILL QUERY ID USER +--echo # +--error ER_PARSE_ERROR +kill query id user 'foo'; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a1616024fb8..6eb47f1e49f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1033,7 +1033,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); Currently there are 98 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 109 +%expect 115 /* Comments for TOKENS. @@ -13525,7 +13525,7 @@ kill: lex->sql_command= SQLCOM_KILL; lex->kill_type= KILL_TYPE_ID; } - kill_type kill_option kill_expr + kill_type kill_option { Lex->kill_signal= (killed_state) ($3 | $4); } @@ -13538,16 +13538,21 @@ kill_type: ; kill_option: - /* empty */ { $$= (int) KILL_CONNECTION; } - | CONNECTION_SYM { $$= (int) KILL_CONNECTION; } - | QUERY_SYM { $$= (int) KILL_QUERY; } - | QUERY_SYM ID_SYM + opt_connection kill_expr { $$= (int) KILL_CONNECTION; } + | QUERY_SYM kill_expr { $$= (int) KILL_QUERY; } + | QUERY_SYM ID_SYM expr { $$= (int) KILL_QUERY; Lex->kill_type= KILL_TYPE_QUERY; + Lex->value_list.push_front($3, thd->mem_root); } ; +opt_connection: + /* empty */ { } + | CONNECTION_SYM { } + ; + kill_expr: expr { @@ -13560,7 +13565,6 @@ kill_expr: } ; - shutdown: SHUTDOWN { Lex->sql_command= SQLCOM_SHUTDOWN; } ;