Commit d190e08e authored by serg@serg.mylan's avatar serg@serg.mylan

merged

parents b65fbcbc e7504b34
...@@ -15,6 +15,20 @@ select 4; ...@@ -15,6 +15,20 @@ select 4;
4 4
4 4
drop table t1; 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 t1 (id int primary key);
create table t2 (id int unsigned not null); create table t2 (id int unsigned not null);
insert into t2 select id from t1; insert into t2 select id from t1;
......
...@@ -46,8 +46,12 @@ select @id != connection_id(); ...@@ -46,8 +46,12 @@ select @id != connection_id();
connection con2; connection con2;
select 4; select 4;
drop table t1; drop table t1;
connection default; connection default;
disconnect con2;
--error 1064
kill (select count(*) from mysql.user);
# #
# BUG#14851: killing long running subquery processed via a temporary table. # BUG#14851: killing long running subquery processed via a temporary table.
# #
......
...@@ -5490,9 +5490,8 @@ select_derived2: ...@@ -5490,9 +5490,8 @@ select_derived2:
{ {
LEX *lex= Lex; LEX *lex= Lex;
lex->derived_tables|= DERIVED_SUBQUERY; lex->derived_tables|= DERIVED_SUBQUERY;
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN && if (lex->sql_command == (int)SQLCOM_HA_READ ||
lex->sql_command <= (int)SQLCOM_HA_READ) || lex->sql_command == (int)SQLCOM_KILL)
lex->sql_command == (int)SQLCOM_KILL)
{ {
yyerror(ER(ER_SYNTAX_ERROR)); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; YYABORT;
...@@ -6891,18 +6890,18 @@ purge_option: ...@@ -6891,18 +6890,18 @@ purge_option:
/* kill threads */ /* kill threads */
kill: kill:
KILL_SYM kill_option expr KILL_SYM { Lex->sql_command= SQLCOM_KILL; } kill_option expr
{ {
LEX *lex=Lex; LEX *lex=Lex;
lex->value_list.empty(); lex->value_list.empty();
lex->value_list.push_front($3); lex->value_list.push_front($4);
lex->sql_command= SQLCOM_KILL;
}; };
kill_option: kill_option:
/* empty */ { Lex->type= 0; } /* empty */ { Lex->type= 0; }
| CONNECTION_SYM { Lex->type= 0; } | CONNECTION_SYM { Lex->type= 0; }
| QUERY_SYM { Lex->type= ONLY_KILL_QUERY; }; | QUERY_SYM { Lex->type= ONLY_KILL_QUERY; }
;
/* change database */ /* change database */
...@@ -6915,7 +6914,7 @@ use: USE_SYM ident ...@@ -6915,7 +6914,7 @@ use: USE_SYM ident
/* import, export of files */ /* import, export of files */
load: LOAD DATA_SYM load: LOAD DATA_SYM
{ {
LEX *lex=Lex; LEX *lex=Lex;
if (lex->sphead) if (lex->sphead)
...@@ -8939,9 +8938,8 @@ subselect_start: ...@@ -8939,9 +8938,8 @@ subselect_start:
'(' SELECT_SYM '(' SELECT_SYM
{ {
LEX *lex=Lex; LEX *lex=Lex;
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN && if (lex->sql_command == (int)SQLCOM_HA_READ ||
lex->sql_command <= (int)SQLCOM_HA_READ) || lex->sql_command == (int)SQLCOM_KILL)
lex->sql_command == (int)SQLCOM_KILL)
{ {
yyerror(ER(ER_SYNTAX_ERROR)); yyerror(ER(ER_SYNTAX_ERROR));
YYABORT; 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