Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.11, 11.4, 11.8, 12.3
-
Unexpected results
-
A snapshot that was created before ALTER TABLE…IMPORTED TABLESPACE would fail to report ER_TABLE_DEF_CHANGED.
Description
Oracle released a MySQL bug fix without a test case:
Bug#36999166 ALTER TABLE ... IMPORT TABLESPACE may cause unsafe reads
It is easy to reproduce this with a small change to an existing test case:
diff --git a/mysql-test/suite/innodb/t/import_bugs.test b/mysql-test/suite/innodb/t/import_bugs.test
|
index 1b7edcf8f73..82aa6e0996c 100644
|
--- a/mysql-test/suite/innodb/t/import_bugs.test
|
+++ b/mysql-test/suite/innodb/t/import_bugs.test
|
@@ -53,6 +53,10 @@ CREATE TABLE t1(
|
|
CREATE TABLE t2 LIKE t1;
|
|
+--connect mvcc,localhost,root
|
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
+--connection default
|
+
|
ALTER TABLE t2 DISCARD TABLESPACE;
|
|
INSERT INTO t1() VALUES();
|
@@ -80,6 +84,11 @@ INSERT INTO t2() VALUES();
|
INSERT INTO t2() VALUES();
|
|
SELECT * FROM t2 ORDER BY id;
|
+
|
+--connection mvcc
|
+SELECT * FROM t2;
|
+--disconnect mvcc
|
+--connection default
|
DROP TABLE t2;
|
|
--echo # |
We would expect the SELECT to fail with an error. Instead, it is returning the contents of the imported table, which does not correspond to the snapshot.
Attachments
Issue Links
- blocks
-
MDEV-41670 Merge applicable InnoDB changes from MySQL 8.4.13
-
- Open
-
- relates to
-
MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE
-
- Closed
-
-
MDEV-41694 Read view after DDL returns wrong data when the table definition was reloaded
-
- In Review
-