summaryrefslogtreecommitdiff
path: root/mysql-test/r/temp_table.result
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2018-09-12 16:36:45 +0400
committerMarko Mäkelä <marko.makela@mariadb.com>2019-05-14 15:23:09 +0300
commit95fb88d5469e9d601aa9c2f319d1b561925e9795 (patch)
tree396d6a2a905c35027324fce33d595441a71e3d4c /mysql-test/r/temp_table.result
parent43bbf88dcbab470947af0567f265d9659b07aab8 (diff)
downloadmariadb-git-95fb88d5469e9d601aa9c2f319d1b561925e9795.tar.gz
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.
Diffstat (limited to 'mysql-test/r/temp_table.result')
-rw-r--r--mysql-test/r/temp_table.result24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index b833f4f9768..a89f44f68d4 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -548,3 +548,27 @@ DROP TABLE nonexisting_table, t1;
ERROR 42S02: Unknown table 'temp_db.nonexisting_table'
# Cleanup
DROP DATABASE temp_db;
+USE test;
+#
+# MDEV-17167 - InnoDB: Failing assertion: table->get_ref_count() == 0
+# upon truncating a temporary table
+#
+CREATE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB;
+SELECT * FROM t1 AS t1a1, t1 AS t2a2;
+a a
+TRUNCATE TABLE t1;
+LOCK TABLES t1 WRITE;
+TRUNCATE TABLE t1;
+SELECT * FROM t1;
+a
+UNLOCK TABLES;
+LOCK TABLES t1 AS t1a1 WRITE, t1 AS t1a2 WRITE;
+TRUNCATE TABLE t1;
+SELECT * FROM t1 AS t1a1, t1 AS t1a2;
+a a
+UNLOCK TABLES;
+CREATE TABLE t2(a INT) ENGINE=InnoDB;
+LOCK TABLES t2 WRITE;
+TRUNCATE TABLE t1;
+UNLOCK TABLES;
+DROP TABLE t1, t2;