Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.7
-
None
-
10.1.8-2
Description
- Create page compressed table
- Export and discard tablespace
- Restart server and import tablespace
Error: ALTER TABLE t1 IMPORT TABLESPACE' failed: 1815: Internal error: Cannot reset LSNs in table '"test"."t1"' : Data structure corruption
Test case:
--source include/have_innodb.inc
|
# embedded does not support restart
|
-- source include/not_embedded.inc
|
-- source include/not_valgrind.inc
|
# Avoid CrashReporter popup on Mac
|
-- source include/not_crashrep.inc
|
|
--disable_query_log
|
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
|
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
--enable_query_log
|
|
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
|
--let $MYSQLD_DATADIR = `SELECT @@datadir`
|
--let SEARCH_RANGE = 10000000
|
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
|
SET GLOBAL innodb_file_format = `Barracuda`;
|
SET GLOBAL innodb_file_per_table = ON;
|
set global innodb_compression_algorithm = 1;
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1;
|
SHOW WARNINGS;
|
SHOW CREATE TABLE t1;
|
INSERT INTO t1 VALUES (1,'foobar'),(2,'barfoo');
|
FLUSH TABLE t1 FOR EXPORT;
|
--echo # List before copying files
|
--list_files $MYSQLD_DATADIR/test
|
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
|
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
|
UNLOCK TABLES;
|
|
--sleep 5
|
--echo # Tablespaces should be still encrypted
|
--let SEARCH_PATTERN=foobar
|
--echo # t1 yes on expecting NOT FOUND
|
-- let SEARCH_FILE=$t1_IBD
|
-- source include/search_pattern_in_file.inc
|
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
|
--source include/restart_mysqld.inc
|
|
SET GLOBAL innodb_file_format = `Barracuda`;
|
SET GLOBAL innodb_file_per_table = ON;
|
--echo # List after t1 DISCARD
|
--list_files $MYSQLD_DATADIR/test
|
--copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
|
--copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
|
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
SHOW CREATE TABLE t1;
|
SELECT * FROM t1;
|
--sleep 5
|
--echo # Tablespaces should be still encrypted
|
-- let SEARCH_FILE=$t1_IBD
|
--let SEARCH_PATTERN=foobar
|
--echo # t1 yes on expecting NOT FOUND
|
-- let SEARCH_FILE=$t1_IBD
|
-- source include/search_pattern_in_file.inc
|
|
# reset system
|
--disable_query_log
|
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
|
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
|
--enable_query_log
|