summaryrefslogtreecommitdiff
path: root/mysql-test/main/temp_table.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/temp_table.test')
-rw-r--r--mysql-test/main/temp_table.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/main/temp_table.test b/mysql-test/main/temp_table.test
index a1e61b31a82..bd3bba34f89 100644
--- a/mysql-test/main/temp_table.test
+++ b/mysql-test/main/temp_table.test
@@ -623,3 +623,19 @@ TRUNCATE TABLE t1;
UNLOCK TABLES;
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-19449 1030: Got error 168 "Unknown (generic) error from engine"
+--echo # for valid TRUNCATE (temporary) TABLE
+--echo #
+
+CREATE TEMPORARY TABLE t1 (col1 BIGINT) ENGINE = InnoDB;
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1 (no_such_col) SELECT * FROM t1;
+TRUNCATE TABLE t1;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t1 CHANGE no_such_col1 col1 BIGINT NULL;
+# This would wrongly try to re-truncate the old copy of the table that
+# was not dropped during the first TRUNCATE due to extra table handles.
+TRUNCATE TABLE t1;
+DROP TEMPORARY TABLE t1;