mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-19449 Got error 168 for valid TRUNCATE (temporary) TABLE
Add the test case.
The parent commit, which cherry-picked the MDEV-17167 fix from 10.3
(commit bad2f1569d
)
fixed the bug.
This commit is contained in:
@@ -572,3 +572,15 @@ LOCK TABLES t2 WRITE;
|
|||||||
TRUNCATE TABLE t1;
|
TRUNCATE TABLE t1;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
#
|
||||||
|
# MDEV-19449 1030: Got error 168 "Unknown (generic) error from engine"
|
||||||
|
# for valid TRUNCATE (temporary) TABLE
|
||||||
|
#
|
||||||
|
CREATE TEMPORARY TABLE t1 (col1 BIGINT) ENGINE = InnoDB;
|
||||||
|
INSERT INTO t1 (no_such_col) SELECT * FROM t1;
|
||||||
|
ERROR 42S22: Unknown column 'no_such_col' in 'field list'
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
ALTER TABLE t1 CHANGE no_such_col1 col1 BIGINT NULL;
|
||||||
|
ERROR 42S22: Unknown column 'no_such_col1' in 't1'
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
DROP TEMPORARY TABLE t1;
|
||||||
|
@@ -623,3 +623,19 @@ TRUNCATE TABLE t1;
|
|||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
DROP TABLE t1, t2;
|
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;
|
||||||
|
Reference in New Issue
Block a user