[Commits] 5b02c215cd6: MDEV-16036: Debug assertion failed in resignal on create temporary table
revision-id: 5b02c215cd600ce762892526e2f5604511308fb3 (mariadb-10.3.10-120-g5b02c215cd6) parent(s): b26736cdb1105f5c500c0a6b51954ac4a83665b0 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-12-20 11:22:13 +0100 message: MDEV-16036: Debug assertion failed in resignal on create temporary table Reising condition on NOTW controlled by OPTION_SQL_NOTES. --- mysql-test/main/sp.result | 35 +++++++++++++++++++++++++++++++++++ mysql-test/main/sp.test | 34 ++++++++++++++++++++++++++++++++++ sql/sql_signal.cc | 7 ++----- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result index 64668e0c8ec..b7a2f865c1d 100644 --- a/mysql-test/main/sp.result +++ b/mysql-test/main/sp.result @@ -8731,3 +8731,38 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; DROP FUNCTION f1; +# +# MDEV-16036: Debug assertion failed in resignal on create +# temporary table +# +set @save_sql_mode= @@sql_mode; +set sql_mode='ORACLE'; +CREATE or replace procedure p4() +AS +CONTINUE HANDLER FOR SQLWARNING +BEGIN +NULL; +END; +EXIT HANDLER FOR OTHERS -- SQLEXCEPTION +BEGIN +GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE, @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT; +SELECT @sqlstate, @errno, @text; +SHOW WARNINGS; +RESIGNAL; -- cause DBG_ASSERT failed +END; +BEGIN +CREATE TEMPORARY TABLE IF NOT EXISTS t1(origine VARCHAR2(10) NOT NULL); +END +/ +call p4(); +call p4(); +@sqlstate @errno @text +42S01 1050 Table 't1' already exists +Level Code Message +Note 1050 Table 't1' already exists +Warnings: +Note 1050 Table 't1' already exists +drop procedure p4; +drop table t1; +set @@sql_mode=@save_sql_mode; +# End of 10.3 tests diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test index 72e6ad6bcba..98b85983687 100644 --- a/mysql-test/main/sp.test +++ b/mysql-test/main/sp.test @@ -10252,3 +10252,37 @@ CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3; SHOW CREATE TABLE t1; DROP TABLE t1; DROP FUNCTION f1; + +--echo # +--echo # MDEV-16036: Debug assertion failed in resignal on create +--echo # temporary table +--echo # + +set @save_sql_mode= @@sql_mode; +set sql_mode='ORACLE'; +delimiter /; +CREATE or replace procedure p4() +AS + CONTINUE HANDLER FOR SQLWARNING + BEGIN + NULL; + END; + EXIT HANDLER FOR OTHERS -- SQLEXCEPTION + BEGIN + GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE, @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT; + SELECT @sqlstate, @errno, @text; + SHOW WARNINGS; + RESIGNAL; -- cause DBG_ASSERT failed + END; +BEGIN + CREATE TEMPORARY TABLE IF NOT EXISTS t1(origine VARCHAR2(10) NOT NULL); +END +/ +delimiter ;/ +call p4(); +call p4(); +drop procedure p4; +drop table t1; +set @@sql_mode=@save_sql_mode; + +--echo # End of 10.3 tests diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc index a92d40f6bb3..70a61185618 100644 --- a/sql/sql_signal.cc +++ b/sql/sql_signal.cc @@ -343,13 +343,10 @@ bool Sql_cmd_common_signal::raise_condition(THD *thd, Sql_condition *cond) if (eval_signal_informations(thd, cond)) DBUG_RETURN(result); - /* SIGNAL should not signal WARN_LEVEL_NOTE */ - DBUG_ASSERT((cond->m_level == Sql_condition::WARN_LEVEL_WARN) || - (cond->m_level == Sql_condition::WARN_LEVEL_ERROR)); - (void) thd->raise_condition(cond); - if (cond->m_level == Sql_condition::WARN_LEVEL_WARN) + if (cond->m_level == Sql_condition::WARN_LEVEL_WARN || + cond->m_level == Sql_condition::WARN_LEVEL_NOTE) { my_ok(thd); result= FALSE;
participants (1)
-
Oleksandr Byelkin