From 0366fb5f54aa89655bb9bb99810e8f0a3ae35309 Mon Sep 17 00:00:00 2001 From: Nayuta Yanagisawa Date: Tue, 25 Jan 2022 13:26:21 +0900 Subject: MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values When a partition with engine-defined partition options is added by ALTER, it shows the correct definition in SHOW CREATE, but the actual values get inherited from the previous partition. The cause of the bug is that the server did not parse the options associated with the newly added partition. In the case of ALTER, the complete part_info, which represents the partition structure after ALTER, is built by prep_alter_part_table(). So, we need to parse engine-defined partition options after the call of the function. --- .../parts/r/engine_defined_part_attributes.result | 70 ++++++++++++++++++++++ .../parts/t/engine_defined_part_attributes.test | 47 +++++++++++++++ 2 files changed, 117 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/parts/r/engine_defined_part_attributes.result b/mysql-test/suite/parts/r/engine_defined_part_attributes.result index 81063d82c6f..f31d5e901fb 100644 --- a/mysql-test/suite/parts/r/engine_defined_part_attributes.result +++ b/mysql-test/suite/parts/r/engine_defined_part_attributes.result @@ -216,3 +216,73 @@ SUBPARTITION BY HASH (`id`) (SUBPARTITION `spt3` ENGINE = InnoDB, SUBPARTITION `spt4` ENGINE = InnoDB)) DROP TABLE `t11`; +# +# MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values +# +# restart: --innodb-sys-tablespaces +CREATE TABLE `t12` ( +id INT +) ENGINE=InnoDB PARTITION BY HASH(id) +( +pt1 PAGE_COMPRESSED=0 +); +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%'; +name flag +test/t12#P#pt1 21 +ALTER TABLE `t12` ADD PARTITION ( +PARTITION pt2 PAGE_COMPRESSED=1 +); +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%'; +name flag +test/t12#P#pt1 21 +test/t12#P#pt2 1610612789 +ALTER TABLE `t12` ADD PARTITION ( +PARTITION pt3 PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3 +); +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%'; +name flag +test/t12#P#pt1 21 +test/t12#P#pt2 1610612789 +test/t12#P#pt3 805306421 +DROP TABLE `t12`; +CREATE TABLE `t13` ( +`id` INT +) ENGINE=InnoDB PAGE_COMPRESSED=1 PARTITION BY RANGE(id) ( +PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=0, +PARTITION pt2 VALUES LESS THAN (200) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3, +PARTITION pt3 VALUES LESS THAN MAXVALUE +); +SHOW CREATE TABLE `t13`; +Table Create Table +t13 CREATE TABLE `t13` ( + `id` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 + PARTITION BY RANGE (`id`) +(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB PAGE_COMPRESSED = 0, + PARTITION `pt2` VALUES LESS THAN (200) ENGINE = InnoDB PAGE_COMPRESSED = 1 PAGE_COMPRESSION_LEVEL = 3, + PARTITION `pt3` VALUES LESS THAN MAXVALUE ENGINE = InnoDB) +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%'; +name flag +test/t13#P#pt1 21 +test/t13#P#pt2 805306421 +test/t13#P#pt3 1610612789 +ALTER TABLE `t13` PARTITION BY RANGE(id) ( +PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3, +PARTITION pt2 VALUES LESS THAN (200), +PARTITION pt3 VALUES LESS THAN MAXVALUE PAGE_COMPRESSED=0 +); +SHOW CREATE TABLE `t13`; +Table Create Table +t13 CREATE TABLE `t13` ( + `id` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=1 + PARTITION BY RANGE (`id`) +(PARTITION `pt1` VALUES LESS THAN (100) ENGINE = InnoDB PAGE_COMPRESSED = 1 PAGE_COMPRESSION_LEVEL = 3, + PARTITION `pt2` VALUES LESS THAN (200) ENGINE = InnoDB, + PARTITION `pt3` VALUES LESS THAN MAXVALUE ENGINE = InnoDB PAGE_COMPRESSED = 0) +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%'; +name flag +test/t13#P#pt1 805306421 +test/t13#P#pt2 1610612789 +test/t13#P#pt3 21 +DROP TABLE `t13`; diff --git a/mysql-test/suite/parts/t/engine_defined_part_attributes.test b/mysql-test/suite/parts/t/engine_defined_part_attributes.test index 8d08f4654cc..22aec9286e9 100644 --- a/mysql-test/suite/parts/t/engine_defined_part_attributes.test +++ b/mysql-test/suite/parts/t/engine_defined_part_attributes.test @@ -167,3 +167,50 @@ SUBPARTITION BY HASH(id) ( SHOW CREATE TABLE `t11`; DROP TABLE `t11`; + +--echo # +--echo # MDEV-27605 ALTER .. ADD PARTITION uses wrong partition-level option values +--echo # + +--let $restart_parameters= --innodb-sys-tablespaces +--source include/restart_mysqld.inc + +CREATE TABLE `t12` ( + id INT +) ENGINE=InnoDB PARTITION BY HASH(id) +( + pt1 PAGE_COMPRESSED=0 +); +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%'; + +ALTER TABLE `t12` ADD PARTITION ( + PARTITION pt2 PAGE_COMPRESSED=1 +); +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%'; + +ALTER TABLE `t12` ADD PARTITION ( + PARTITION pt3 PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3 +); +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%'; + +DROP TABLE `t12`; + +CREATE TABLE `t13` ( + `id` INT +) ENGINE=InnoDB PAGE_COMPRESSED=1 PARTITION BY RANGE(id) ( + PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=0, + PARTITION pt2 VALUES LESS THAN (200) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3, + PARTITION pt3 VALUES LESS THAN MAXVALUE +); +SHOW CREATE TABLE `t13`; +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%'; + +ALTER TABLE `t13` PARTITION BY RANGE(id) ( + PARTITION pt1 VALUES LESS THAN (100) PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3, + PARTITION pt2 VALUES LESS THAN (200), + PARTITION pt3 VALUES LESS THAN MAXVALUE PAGE_COMPRESSED=0 +); +SHOW CREATE TABLE `t13`; +SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%'; + +DROP TABLE `t13`; -- cgit v1.2.1 From 2db80c377328b696120c77bf20c3bfa923137e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 1 Mar 2022 17:52:45 +0200 Subject: MDEV-27973 SIGSEGV in ha_innobase::reset() after TRUNCATE of TEMPORARY TABLE create_table_info_t::innobase_table_flags(): Ignore page_compressed and page_compression_level on TEMPORARY tables. ha_innobase::truncate(): Add a debug assertion that create() must succeed on temporary tables. --- mysql-test/suite/innodb/r/default_row_format_create.result | 3 +++ mysql-test/suite/innodb/t/default_row_format_create.test | 3 +++ 2 files changed, 6 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/default_row_format_create.result b/mysql-test/suite/innodb/r/default_row_format_create.result index 50adc757b62..a1334101b61 100644 --- a/mysql-test/suite/innodb/r/default_row_format_create.result +++ b/mysql-test/suite/innodb/r/default_row_format_create.result @@ -58,10 +58,13 @@ CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1; DROP TABLE IF EXISTS t; SET GLOBAL innodb_compression_level=1; CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1; +CREATE TEMPORARY TABLE tt(a INT PRIMARY KEY) +ROW_FORMAT=DYNAMIC page_compressed=1 ENGINE=InnoDB; SET GLOBAL innodb_compression_level=0; ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE; ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED' ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY; ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options") DROP TABLE t; +TRUNCATE tt; SET GLOBAL innodb_compression_level=@save_level; diff --git a/mysql-test/suite/innodb/t/default_row_format_create.test b/mysql-test/suite/innodb/t/default_row_format_create.test index 0b3e0d25f00..cd497d74de7 100644 --- a/mysql-test/suite/innodb/t/default_row_format_create.test +++ b/mysql-test/suite/innodb/t/default_row_format_create.test @@ -69,10 +69,13 @@ DROP TABLE IF EXISTS t; SET GLOBAL innodb_compression_level=1; CREATE TABLE t(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1; +CREATE TEMPORARY TABLE tt(a INT PRIMARY KEY) +ROW_FORMAT=DYNAMIC page_compressed=1 ENGINE=InnoDB; SET GLOBAL innodb_compression_level=0; --error ER_ILLEGAL_HA_CREATE_OPTION ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=INPLACE; --error ER_CANT_CREATE_TABLE ALTER TABLE t FORCE, ROW_FORMAT=DEFAULT, ALGORITHM=COPY; DROP TABLE t; +TRUNCATE tt; SET GLOBAL innodb_compression_level=@save_level; -- cgit v1.2.1 From 1fa872f6ef57d25ad050dc1dadda27e4a0297751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Wed, 2 Mar 2022 18:18:43 -0800 Subject: Fix various spelling errors Among others: existance -> existence reinitialze -> reinitialize successfuly -> successfully --- mysql-test/suite/archive/discover.result | 2 +- mysql-test/suite/archive/discover.test | 4 ++-- mysql-test/suite/mariabackup/log_page_corruption.result | 4 ++-- mysql-test/suite/mariabackup/log_page_corruption.test | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/archive/discover.result b/mysql-test/suite/archive/discover.result index 99bb955ea24..74ba3752373 100644 --- a/mysql-test/suite/archive/discover.result +++ b/mysql-test/suite/archive/discover.result @@ -84,7 +84,7 @@ drop table t1; db.opt t0.ARZ # -# discover of table non-existance on drop +# discover of table non-existence on drop # select * from t0; a diff --git a/mysql-test/suite/archive/discover.test b/mysql-test/suite/archive/discover.test index 4ab35cf1115..1bced9edcbc 100644 --- a/mysql-test/suite/archive/discover.test +++ b/mysql-test/suite/archive/discover.test @@ -67,7 +67,7 @@ drop table t1; --list_files $mysqld_datadir/test --echo # ---echo # discover of table non-existance on drop +--echo # discover of table non-existence on drop --echo # select * from t0; remove_file $mysqld_datadir/test/t0.ARZ; @@ -119,7 +119,7 @@ select * from t1; --list_files $mysqld_datadir/test # -# MDEV-4955 discover of table non-existance on CREATE +# MDEV-4955 discover of table non-existence on CREATE # create table t1 (a int) engine=archive; select * from t1; diff --git a/mysql-test/suite/mariabackup/log_page_corruption.result b/mysql-test/suite/mariabackup/log_page_corruption.result index 91db833622a..4dcd21f1e2f 100644 --- a/mysql-test/suite/mariabackup/log_page_corruption.result +++ b/mysql-test/suite/mariabackup/log_page_corruption.result @@ -98,12 +98,12 @@ test/t3_inc ------ # Full backup prepare # "innodb_corrupted_pages" file must not exist after successful prepare -FOUND 1 /was successfuly fixed.*/ in backup.log +FOUND 1 /was successfully fixed.*/ in backup.log # Check that fixed pages are zero-filled # Incremental backup prepare # "innodb_corrupted_pages" file must not exist after successful prepare # do not remove "innodb_corrupted_pages" in incremental dir -FOUND 1 /was successfuly fixed.*/ in backup.log +FOUND 1 /was successfully fixed.*/ in backup.log # Check that fixed pages are zero-filled # shutdown server # remove datadir diff --git a/mysql-test/suite/mariabackup/log_page_corruption.test b/mysql-test/suite/mariabackup/log_page_corruption.test index 0151afb96b4..8931eb1eaf7 100644 --- a/mysql-test/suite/mariabackup/log_page_corruption.test +++ b/mysql-test/suite/mariabackup/log_page_corruption.test @@ -323,7 +323,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir > $backuplog; --echo # "innodb_corrupted_pages" file must not exist after successful prepare --error 1 --file_exists $targetdir/innodb_corrupted_pages ---let SEARCH_PATTERN=was successfuly fixed.* +--let SEARCH_PATTERN=was successfully fixed.* --let SEARCH_FILE=$backuplog --source include/search_pattern_in_file.inc @@ -347,7 +347,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir --incremental-dir=$incdir > $ --file_exists $targetdir/innodb_corrupted_pages --echo # do not remove "innodb_corrupted_pages" in incremental dir --file_exists $incdir/innodb_corrupted_pages ---let SEARCH_PATTERN=was successfuly fixed.* +--let SEARCH_PATTERN=was successfully fixed.* --let SEARCH_FILE=$backuplog --source include/search_pattern_in_file.inc -- cgit v1.2.1