summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-09-10 17:41:26 +0530
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-10 17:41:26 +0530
commite2f570bff872532dcae5f2cf882e01f40c9aacd2 (patch)
tree2a3c53445c9a05917a975b554a2f0988870d162e /mysql-test/suite/innodb/t
parent13f740904a389f03d3c075fee0b91ecfcc0de60b (diff)
downloadmariadb-git-e2f570bff872532dcae5f2cf882e01f40c9aacd2.tar.gz
MDEV-20320 Tablespace flags mismatch for full_crc32 format
Files for PAGE_COMPRESSED tables that were created with innodb_checksum_algorithm=full_crc32 store the value of innodb_compression_algorithm at the time of the file creation. The server-wide setting of innodb_compression_algorithm may be changed after file creation. We must ignore any mismatch when opening a data file, and for writes, we must use the choice of algorithm that is stored in the file. fil_space_t::is_flags_full_crc32_equal(): Ignore the innodb_compression_algorithm but do compare innodb_page_size. fil_space_t::is_flags_non_full_crc32_equal(): Ignore the innodb_compression_algorithm.
Diffstat (limited to 'mysql-test/suite/innodb/t')
-rw-r--r--mysql-test/suite/innodb/t/full_crc32_import.test61
1 files changed, 61 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/full_crc32_import.test b/mysql-test/suite/innodb/t/full_crc32_import.test
index 3916b52d073..c5b50997a70 100644
--- a/mysql-test/suite/innodb/t/full_crc32_import.test
+++ b/mysql-test/suite/innodb/t/full_crc32_import.test
@@ -137,3 +137,64 @@ DELETE FROM t1;
CHECK TABLE t1;
--source include/wait_all_purged.inc
DROP TABLE t1;
+
+SET @save_algo = @@GLOBAL.innodb_compression_algorithm;
+SET GLOBAL innodb_compression_algorithm=2;
+CREATE TABLE t1(a SERIAL) PAGE_COMPRESSED=1 ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+FLUSH TABLE t1 FOR EXPORT;
+--echo # List before copying files
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+
+--list_files $MYSQLD_DATADIR/test
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+
+UNLOCK TABLES;
+SET GLOBAL innodb_compression_algorithm=0;
+ALTER TABLE t1 FORCE;
+ALTER TABLE t1 DISCARD TABLESPACE;
+
+--list_files $MYSQLD_DATADIR/test
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+INSERT INTO t1 VALUES(2);
+SELECT * FROM t1;
+
+SET GLOBAL innodb_compression_algorithm=3;
+FLUSH TABLE t1 FOR EXPORT;
+--echo # List before copying files
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+
+--list_files $MYSQLD_DATADIR/test
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_backup_tablespaces("test", "t1");
+EOF
+
+UNLOCK TABLES;
+SET GLOBAL innodb_compression_algorithm=0;
+ALTER TABLE t1 FORCE;
+ALTER TABLE t1 DISCARD TABLESPACE;
+
+--list_files $MYSQLD_DATADIR/test
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+INSERT INTO t1 VALUES(3);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+SET GLOBAL innodb_compression_algorithm=@save_algo;