File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -572,3 +572,15 @@ LOCK TABLES t2 WRITE;
572
572
TRUNCATE TABLE t1;
573
573
UNLOCK TABLES;
574
574
DROP TABLE t1, t2;
575
+ #
576
+ # MDEV-19449 1030: Got error 168 "Unknown (generic) error from engine"
577
+ # for valid TRUNCATE (temporary) TABLE
578
+ #
579
+ CREATE TEMPORARY TABLE t1 (col1 BIGINT) ENGINE = InnoDB;
580
+ INSERT INTO t1 (no_such_col) SELECT * FROM t1;
581
+ ERROR 42S22: Unknown column 'no_such_col' in 'field list'
582
+ TRUNCATE TABLE t1;
583
+ ALTER TABLE t1 CHANGE no_such_col1 col1 BIGINT NULL;
584
+ ERROR 42S22: Unknown column 'no_such_col1' in 't1'
585
+ TRUNCATE TABLE t1;
586
+ DROP TEMPORARY TABLE t1;
Original file line number Diff line number Diff line change @@ -623,3 +623,19 @@ TRUNCATE TABLE t1;
623
623
UNLOCK TABLES;
624
624
625
625
DROP TABLE t1, t2;
626
+
627
+ --echo #
628
+ --echo # MDEV-19449 1030: Got error 168 "Unknown (generic) error from engine"
629
+ --echo # for valid TRUNCATE (temporary) TABLE
630
+ --echo #
631
+
632
+ CREATE TEMPORARY TABLE t1 (col1 BIGINT) ENGINE = InnoDB;
633
+ --error ER_BAD_FIELD_ERROR
634
+ INSERT INTO t1 (no_such_col) SELECT * FROM t1;
635
+ TRUNCATE TABLE t1;
636
+ --error ER_BAD_FIELD_ERROR
637
+ ALTER TABLE t1 CHANGE no_such_col1 col1 BIGINT NULL;
638
+ # This would wrongly try to re-truncate the old copy of the table that
639
+ # was not dropped during the first TRUNCATE due to extra table handles.
640
+ TRUNCATE TABLE t1;
641
+ DROP TEMPORARY TABLE t1;
You can’t perform that action at this time.
0 commit comments