mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
kill (subquery) - three years old bugfix that never worked
This commit is contained in:
@ -17,3 +17,5 @@ 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
|
||||||
|
@ -40,4 +40,7 @@ connection con2;
|
|||||||
select 4;
|
select 4;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--error 1064
|
||||||
|
kill (select count(*) from mysql.user);
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
@ -3564,9 +3564,8 @@ select_derived2:
|
|||||||
{
|
{
|
||||||
LEX *lex= Lex;
|
LEX *lex= Lex;
|
||||||
lex->derived_tables= 1;
|
lex->derived_tables= 1;
|
||||||
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;
|
||||||
@ -4739,16 +4738,15 @@ purge_option:
|
|||||||
/* kill threads */
|
/* kill threads */
|
||||||
|
|
||||||
kill:
|
kill:
|
||||||
KILL_SYM expr
|
KILL_SYM { Lex->sql_command= SQLCOM_KILL; } expr
|
||||||
{
|
{
|
||||||
LEX *lex=Lex;
|
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);
|
send_error(lex->thd, ER_SET_CONSTANTS_ONLY);
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
lex->sql_command=SQLCOM_KILL;
|
lex->thread_id= (ulong) $3->val_int();
|
||||||
lex->thread_id= (ulong) $2->val_int();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* change database */
|
/* change database */
|
||||||
@ -6162,9 +6160,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;
|
||||||
|
Reference in New Issue
Block a user