diff options
author | unknown <serg@serg.mylan> | 2006-03-06 18:34:38 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2006-03-06 18:34:38 +0100 |
commit | 19a1f488a8bfc5b223c86dc64dffc247b31b9ddf (patch) | |
tree | 7ab6741fc54808f10c5e30a851deb2666c0a374d | |
parent | d86a66d483e4999840958129fa6a2ba9d48ac169 (diff) | |
parent | a127344a6c6954012c5d750e07927501f40d907b (diff) | |
download | mariadb-git-19a1f488a8bfc5b223c86dc64dffc247b31b9ddf.tar.gz |
merged
-rw-r--r-- | mysql-test/r/kill.result | 2 | ||||
-rw-r--r-- | mysql-test/t/kill.test | 7 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 17 |
3 files changed, 14 insertions, 12 deletions
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index 239f9d24e9e..eff59b102de 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -17,6 +17,8 @@ select 4; 4 4 drop table t1; +kill (select count(*) from mysql.user); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(*) from mysql.user)' at line 1 create table t1 (id int primary key); create table t2 (id int unsigned not null); insert into t2 select id from t1; diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 9ef5e272d46..50c4239b45e 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -39,9 +39,12 @@ select @id != connection_id(); connection con2; select 4; drop table t1; - -disconnect con2; connection default; +disconnect con2; + +--error 1064 +kill (select count(*) from mysql.user); + # # BUG#14851: killing long running subquery processed via a temporary table. # diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c99abc7d349..05d95b57abb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3564,9 +3564,8 @@ select_derived2: { LEX *lex= Lex; lex->derived_tables= 1; - if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN && - lex->sql_command <= (int)SQLCOM_HA_READ) || - lex->sql_command == (int)SQLCOM_KILL) + if (lex->sql_command == (int)SQLCOM_HA_READ || + lex->sql_command == (int)SQLCOM_KILL) { yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; @@ -4739,16 +4738,15 @@ purge_option: /* kill threads */ kill: - KILL_SYM expr + KILL_SYM { Lex->sql_command= SQLCOM_KILL; } expr { LEX *lex=Lex; - if ($2->fix_fields(lex->thd, 0, &$2) || $2->check_cols(1)) + if ($3->fix_fields(lex->thd, 0, &$3) || $3->check_cols(1)) { send_error(lex->thd, ER_SET_CONSTANTS_ONLY); YYABORT; } - lex->sql_command=SQLCOM_KILL; - lex->thread_id= (ulong) $2->val_int(); + lex->thread_id= (ulong) $3->val_int(); }; /* change database */ @@ -6162,9 +6160,8 @@ subselect_start: '(' SELECT_SYM { LEX *lex=Lex; - if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN && - lex->sql_command <= (int)SQLCOM_HA_READ) || - lex->sql_command == (int)SQLCOM_KILL) + if (lex->sql_command == (int)SQLCOM_HA_READ || + lex->sql_command == (int)SQLCOM_KILL) { yyerror(ER(ER_SYNTAX_ERROR)); YYABORT; |