Commit b4c2ceb2 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-15769: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed

Adjust the fix for MDEV-15472:
In close_cached_tables(), locked_tables_list.reopen_tables(...) call
might be made when a previous call to some function has already returned
error.
In this scenario, the function should return 0, even if reopen_tables(...)
call has succeeded.
parent 1cb2e033
...@@ -489,3 +489,19 @@ unlock tables; ...@@ -489,3 +489,19 @@ unlock tables;
disconnect con1; disconnect con1;
connection default; connection default;
drop table t1; drop table t1;
#
# MDEV-15769: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
LOCK TABLE t1 READ;
connect con1,localhost,root,,test;
LOCK TABLE t2 WRITE;
SET lock_wait_timeout= 1;
FLUSH TABLES;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
UNLOCK TABLES;
disconnect con1;
connection default;
UNLOCK TABLES;
DROP TABLE t1, t2;
...@@ -598,3 +598,24 @@ unlock tables; ...@@ -598,3 +598,24 @@ unlock tables;
disconnect con1; disconnect con1;
connection default; connection default;
drop table t1; drop table t1;
--echo #
--echo # MDEV-15769: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status
--echo #
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
LOCK TABLE t1 READ;
--connect (con1,localhost,root,,test)
LOCK TABLE t2 WRITE;
SET lock_wait_timeout= 1;
--error ER_LOCK_WAIT_TIMEOUT
FLUSH TABLES;
# Cleanup
UNLOCK TABLES;
--disconnect con1
--connection default
UNLOCK TABLES;
DROP TABLE t1, t2;
...@@ -481,7 +481,8 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, ...@@ -481,7 +481,8 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables,
old locks. This should always succeed (unless some external process old locks. This should always succeed (unless some external process
has removed the tables) has removed the tables)
*/ */
result= thd->locked_tables_list.reopen_tables(thd); if (thd->locked_tables_list.reopen_tables(thd))
result= true;
/* /*
Since downgrade_lock() won't do anything with shared Since downgrade_lock() won't do anything with shared
metadata lock it is much simpler to go through all open tables rather metadata lock it is much simpler to go through all open tables rather
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment