diff options
author | Dmitry Shulga <dmitry.shulga@mariadb.com> | 2022-04-05 20:20:09 +0700 |
---|---|---|
committer | Dmitry Shulga <dmitry.shulga@mariadb.com> | 2022-04-05 20:20:09 +0700 |
commit | f6b09a7ce58f564d8e5c08c799d2fc45cfc10870 (patch) | |
tree | a0a505e469bdc8147d30dafdf0786c13a7314289 /sql/sql_yacc.yy | |
parent | c4ebb2bd04974807b3b81001fd2d733e75dfc1fb (diff) | |
download | mariadb-git-f6b09a7ce58f564d8e5c08c799d2fc45cfc10870.tar.gz |
MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
Some SQL statements that involves subqueries or stored routines could
fail since execution of subqueries or stored routines is not supported
for theses statements. Unfortunately, parsing error could result in
abnormal termination by firing the following assert
DBUG_ASSERT(m_thd == NULL);
in a destructor of the class sp_head.
The reason of the assert firing is that the method
sp_head::restore_thd_mem_root()
is not called on semantic action code to clean up resources allocated
during parsing. This happens since the macros YYABORT is called instead of
MYSQL_YYABORT by semantic action code for some grammar rules.
So, to fix the bug YYABORT was just replaced with MYSQL_YYABORT.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3bda2381230..7d8b02a0f12 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9610,7 +9610,7 @@ subselect: query_expression { if (!($$= Lex->parsed_subselect($1))) - YYABORT; + MYSQL_YYABORT; } ; @@ -9655,14 +9655,14 @@ subquery: else $1->fake_select_lex->braces= false; if (!($$= Lex->parsed_subselect($1))) - YYABORT; + MYSQL_YYABORT; } | '(' with_clause query_expression_no_with_clause ')' { $3->set_with_clause($2); $2->attach_to($3->first_select()); if (!($$= Lex->parsed_subselect($3))) - YYABORT; + MYSQL_YYABORT; } ; |