mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-17167 - InnoDB: Failing assertion: table->get_ref_count() == 0 upon
truncating a temporary table TRUNCATE expects only one TABLE instance (which is used by TRUNCATE itself) to be open. However this requirement wasn't enforced after "MDEV-5535: Cannot reopen temporary table". Fixed by closing unused table instances before performing TRUNCATE.
This commit is contained in:
@ -594,4 +594,30 @@ DROP TABLE nonexisting_table, t1;
|
||||
|
||||
--echo # Cleanup
|
||||
DROP DATABASE temp_db;
|
||||
USE test;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17167 - InnoDB: Failing assertion: table->get_ref_count() == 0
|
||||
--echo # upon truncating a temporary table
|
||||
--echo #
|
||||
CREATE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB;
|
||||
SELECT * FROM t1 AS t1a1, t1 AS t2a2;
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
LOCK TABLES t1 WRITE;
|
||||
TRUNCATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
UNLOCK TABLES;
|
||||
|
||||
LOCK TABLES t1 AS t1a1 WRITE, t1 AS t1a2 WRITE;
|
||||
TRUNCATE TABLE t1;
|
||||
SELECT * FROM t1 AS t1a1, t1 AS t1a2;
|
||||
UNLOCK TABLES;
|
||||
|
||||
CREATE TABLE t2(a INT) ENGINE=InnoDB;
|
||||
LOCK TABLES t2 WRITE;
|
||||
TRUNCATE TABLE t1;
|
||||
UNLOCK TABLES;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
Reference in New Issue
Block a user