[MDEV-28989] Replacing index using default non-copying algorithm causes further ER_TABLE_SCHEMA_MISMATCH upon tablespace import Created: 2022-06-30  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-29144 ER_TABLE_SCHEMA_MISMATCH or InnoDB: F... Closed

 Description   

--source include/have_innodb.inc
--let $datadir= `select @@datadir`
 
CREATE TABLE `t` (
  `pk` int(11) NOT NULL,
  `a` char(32) DEFAULT NULL,
  `b` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `ind` (`a`(8))
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
CREATE OR REPLACE INDEX ind ON t(b);
 
FLUSH TABLES t FOR EXPORT;
 
--copy_file $datadir/test/t.ibd $datadir/test/t.ibd.save
--copy_file $datadir/test/t.cfg $datadir/test/t.cfg.save
 
UNLOCK TABLES;
DROP TABLE t;
 
CREATE TABLE `t` (
  `pk` int(11) NOT NULL,
  `a` char(32) DEFAULT NULL,
  `b` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`pk`),
  KEY `ind` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
ALTER TABLE t DISCARD TABLESPACE;
 
--move_file $datadir/test/t.ibd.save $datadir/test/t.ibd
--move_file $datadir/test/t.cfg.save $datadir/test/t.cfg
 
ALTER TABLE t IMPORT TABLESPACE;
 
# Cleanup
DROP TABLE t;

10.3 efdbb3cf

mysqltest: At line 35: query 'ALTER TABLE t IMPORT TABLESPACE' failed: 1808: Schema mismatch (Column a max prefix mismatch it's 0 in the table and 8 in the tablespace meta file)

If the test is run with --mysqld=--alter-algorithm=copy, it passes.


Generated at Thu Feb 08 10:05:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.