Commit b5c72a84 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-18358: Server crash when using SET STATEMENT max_statement_time

Do not init lex before choosing main select.
parent 1bcb66c5
......@@ -1231,4 +1231,14 @@ SET STATEMENT myisam_sort_buffer_size=800000 FOR OPTIMIZE TABLE t;
Table Op Msg_type Msg_text
test.t optimize status Table is already up to date
SET sql_mode=default;
SET STATEMENT myisam_sort_buffer_size=800000 FOR OPTIMIZE TABLE t;
Table Op Msg_type Msg_text
test.t optimize status Table is already up to date
drop table t;
#
# MDEV-18358: Server crash when using SET STATEMENT max_statement_time
#
SET sql_mode=ORACLE;
SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown';
SET sql_mode=default;
SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown';
......@@ -1135,5 +1135,14 @@ create table t (a int);
SET sql_mode=ORACLE;
SET STATEMENT myisam_sort_buffer_size=800000 FOR OPTIMIZE TABLE t;
SET sql_mode=default;
SET STATEMENT myisam_sort_buffer_size=800000 FOR OPTIMIZE TABLE t;
drop table t;
--echo #
--echo # MDEV-18358: Server crash when using SET STATEMENT max_statement_time
--echo #
SET sql_mode=ORACLE;
SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown';
SET sql_mode=default;
SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown';
......@@ -13679,12 +13679,11 @@ delete:
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_DELETE;
mysql_init_select(lex);
YYPS->m_lock_type= TL_WRITE_DEFAULT;
YYPS->m_mdl_type= MDL_SHARED_WRITE;
if (Lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->ignore= 0;
lex->first_select_lex()->order_list.empty();
}
......
......@@ -13792,12 +13792,11 @@ delete:
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_DELETE;
mysql_init_select(lex);
YYPS->m_lock_type= TL_WRITE_DEFAULT;
YYPS->m_mdl_type= MDL_SHARED_WRITE;
if (Lex->main_select_push())
MYSQL_YYABORT;
mysql_init_select(lex);
lex->ignore= 0;
lex->first_select_lex()->order_list.empty();
}
......
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