Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.6.5
-
None
Description
When importing into another table with different column count the column counts given in the error message do not match visible columns in the table.
Note that the tables below have 3 and 4 columns, respectively, but the error message says 6 and 7
noformat
MariaDB [test]> ALTER TABLE t2 IMPORT TABLESPACE;
ERROR 1808 (HY000): Schema mismatch (Number of columns don't match, table has 6 columns but the tablespace meta-data file has 7 columns)
noformat
How to reproduce
noformat
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id INT NOT NULL,
i1 INT,
i2 INT,
i3 INT,
PRIMARY KEY (id)
) ENGINE=INNODB;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (
id INT NOT NULL,
i1 INT,
i2 INT,
PRIMARY KEY (id)
) ENGINE=INNODB;
ALTER TABLE t2 DISCARD TABLESPACE;
FLUSH TABLES t1 FOR EXPORT;
-
-
- in other terminal
-
cd /var/lib/mysql/test
cp -vp t1.ibd t2.ibd
cp -vp t1.cfg t2.cfg
journalctl -u mariadb.service -f
###
UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;
noformat