diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2021-09-19 19:23:49 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2021-09-19 19:23:49 +0200 |
commit | baaaa971662e1f908dba528f14ebe2624dd09378 (patch) | |
tree | e9c822f3a89aa081c7cf80680c2f4ee36f6eab1a | |
parent | dce490e9d4d91a7e00111bd515db558cadc19d06 (diff) | |
download | mariadb-git-bb-10.2-MDEV-22883.tar.gz |
MDEV-22883: Assertion `!parse_error || lex.sphead == 0' failed in Table_triggers_list::check_n_load | SIGSEGV in strxmovbb-10.2-MDEV-22883
Abort execution of SHOW in case of fatal error.
-rw-r--r-- | mysql-test/r/show.result | 11 | ||||
-rw-r--r-- | mysql-test/t/show.test | 15 | ||||
-rw-r--r-- | sql/sql_show.cc | 6 |
3 files changed, 30 insertions, 2 deletions
diff --git a/mysql-test/r/show.result b/mysql-test/r/show.result index d1b373d8969..c087d1d96d7 100644 --- a/mysql-test/r/show.result +++ b/mysql-test/r/show.result @@ -40,5 +40,16 @@ nm varchar(32) YES NULL a int(11) YES NULL drop table t1; # +# MDEV-22883: Assertion `!parse_error || lex.sphead == 0' failed in +# Table_triggers_list::check_n_load | SIGSEGV in strxmov +# +CREATE TABLE t1 (a INT); +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @a=1; +CREATE TRIGGER tr2 BEFORE DELETE ON t1 FOR EACH ROW SET @b=1; +SET TMP_DISK_TABLE_SIZE= 1024; +SHOW TRIGGERS; +ERROR HY000: The table '(temporary)' is full +DROP TABLE t1; +# # End of 10.2 tests # diff --git a/mysql-test/t/show.test b/mysql-test/t/show.test index f2f6efc4e45..3dfc1c696e4 100644 --- a/mysql-test/t/show.test +++ b/mysql-test/t/show.test @@ -35,5 +35,20 @@ show fields from test.t1 where field in drop table t1; --echo # +--echo # MDEV-22883: Assertion `!parse_error || lex.sphead == 0' failed in +--echo # Table_triggers_list::check_n_load | SIGSEGV in strxmov +--echo # + +CREATE TABLE t1 (a INT); +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @a=1; +CREATE TRIGGER tr2 BEFORE DELETE ON t1 FOR EACH ROW SET @b=1; +SET TMP_DISK_TABLE_SIZE= 1024; +--error ER_RECORD_FILE_FULL +SHOW TRIGGERS; + +# Cleanup +DROP TABLE t1; + +--echo # --echo # End of 10.2 tests --echo # diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 721bb053343..105b2719882 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4849,7 +4849,8 @@ end: */ DBUG_ASSERT(thd->open_tables == NULL); thd->mdl_context.rollback_to_savepoint(open_tables_state_backup->mdl_system_tables_svp); - thd->clear_error(); + if (!thd->is_fatal_error) + thd->clear_error(); return res; } @@ -5064,7 +5065,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) continue; } - if (thd->killed == ABORT_QUERY) + if (thd->killed == ABORT_QUERY || thd->is_fatal_error) { error= 0; goto err; @@ -5079,6 +5080,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) goto err; } } + // Here in 10.3 should be fixed IF with ABORT_QUERY as above } } } |