[Commits] e8d6cf82fe4: MDEV-18358: Server crash when using SET STATEMENT max_statement_time
revision-id: e8d6cf82fe4e33df326d886b2335c3dd625839d5 (mariadb-10.4.3-2-ge8d6cf82fe4) parent(s): 9011fa1ace3c6a49afdf05c714844d938a8c6f99 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2019-03-04 12:17:13 +0100 message: MDEV-18358: Server crash when using SET STATEMENT max_statement_time Do not init lex before choosing main select. --- mysql-test/main/set_statement.result | 10 ++++++++++ mysql-test/main/set_statement.test | 9 +++++++++ sql/sql_yacc.yy | 3 +-- sql/sql_yacc_ora.yy | 3 +-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/mysql-test/main/set_statement.result b/mysql-test/main/set_statement.result index a12954927b6..f3dc0b35ea6 100644 --- a/mysql-test/main/set_statement.result +++ b/mysql-test/main/set_statement.result @@ -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'; diff --git a/mysql-test/main/set_statement.test b/mysql-test/main/set_statement.test index e2a3288106b..0687644abc6 100644 --- a/mysql-test/main/set_statement.test +++ b/mysql-test/main/set_statement.test @@ -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'; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e235a465b1a..686a9801aca 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -13727,12 +13727,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(); } diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 8b072632bf5..8c4c71a1f71 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -13775,12 +13775,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(); }
participants (1)
-
Oleksandr Byelkin