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 /mysql-test/main/ps.result | |
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 'mysql-test/main/ps.result')
-rw-r--r-- | mysql-test/main/ps.result | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result index 6df83228875..5d72cde5dd2 100644 --- a/mysql-test/main/ps.result +++ b/mysql-test/main/ps.result @@ -5650,5 +5650,18 @@ connection default; SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save; DROP USER user1@localhost; # +# MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head +# +CREATE TABLE t1 (a INT); +EXECUTE IMMEDIATE "CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));"; +ERROR 42000: PROCEDURE does not support subqueries or stored functions +DROP TABLE t1; +BEGIN NOT ATOMIC +PREPARE stmt FROM 'SELECT ?'; +EXECUTE stmt USING ((SELECT 1)); +END; +$ +ERROR 42000: EXECUTE..USING does not support subqueries or stored functions +# # End of 10.4 tests # |