mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-19695 Import tablespace doesn't work with ROW_FORMAT=COMPRESSED encrypted tablespace
Problem: ======= fil_iterate() writes imported tablespace page0 as it is to discarded tablespace. Space id wasn't even changed. While opening the tablespace, tablespace fails with space id mismatch error. Fix: ==== fil_iterate() copies the page0 with discarded space id to imported tablespace.
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
|
||||
INSERT INTO t1 VALUES(1, repeat('Nesamani', 10));
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
1
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` int(11) NOT NULL,
|
||||
`a` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES
|
||||
# Wait max 10 min for key encryption threads to encrypt all spaces
|
||||
t1.frm
|
||||
t1.ibd
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
backup: t1
|
||||
t1.cfg
|
||||
t1.frm
|
||||
t1.ibd
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES;
|
||||
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||
restore: t1 .ibd and .cfg files
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
1
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` int(11) NOT NULL,
|
||||
`a` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES
|
||||
DROP TABLE t1;
|
Reference in New Issue
Block a user