Commit 28034d38 authored by unknown's avatar unknown

merged


mysql-test/t/kill.test:
  Auto merged
parents cf471416 88941dca
......@@ -15,6 +15,20 @@ 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;
create table t3 (kill_id int);
insert into t3 values(connection_id());
select id from t1 where id in (select distinct id from t2);
select ((@id := kill_id) - kill_id) from t3;
((@id := kill_id) - kill_id)
0
kill @id;
Got one of the listed errors
drop table t1, t2, t3;
create table t1 (id int primary key);
create table t2 (id int unsigned not null);
insert into t2 select id from t1;
......
......@@ -46,8 +46,12 @@ select @id != connection_id();
connection con2;
select 4;
drop table t1;
connection default;
disconnect con2;
--error 1064
kill (select count(*) from mysql.user);
#
# BUG#14851: killing long running subquery processed via a temporary table.
#
......
......@@ -5490,9 +5490,8 @@ select_derived2:
{
LEX *lex= Lex;
lex->derived_tables|= DERIVED_SUBQUERY;
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;
......@@ -6891,18 +6890,18 @@ purge_option:
/* kill threads */
kill:
KILL_SYM kill_option expr
KILL_SYM { Lex->sql_command= SQLCOM_KILL; } kill_option expr
{
LEX *lex=Lex;
lex->value_list.empty();
lex->value_list.push_front($3);
lex->sql_command= SQLCOM_KILL;
lex->value_list.push_front($4);
};
kill_option:
/* empty */ { Lex->type= 0; }
| CONNECTION_SYM { Lex->type= 0; }
| QUERY_SYM { Lex->type= ONLY_KILL_QUERY; };
| QUERY_SYM { Lex->type= ONLY_KILL_QUERY; }
;
/* change database */
......@@ -6915,7 +6914,7 @@ use: USE_SYM ident
/* import, export of files */
load: LOAD DATA_SYM
load: LOAD DATA_SYM
{
LEX *lex=Lex;
if (lex->sphead)
......@@ -8939,9 +8938,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment