From 7c9cbe684b5b62d7215f5d6d833ea29b7d5da56c Mon Sep 17 00:00:00 2001 From: Dave Gosselin Date: Fri, 13 Dec 2024 14:42:40 -0500 Subject: [PATCH 1/9] MDEV-35648 Update partition lc2 tests for mac Partition tests requiring lower_case_table_names = 2 (default on macOS) fail on mac because the product has changed over time but the tests were not run regularly enough to observe their breakage. --- .../parts/r/partition_mgm_lc2_innodb.result | 49 +++++++++---------- .../parts/r/partition_mgm_lc2_memory.result | 49 +++++++++---------- .../parts/r/partition_mgm_lc2_myisam.result | 49 +++++++++---------- 3 files changed, 72 insertions(+), 75 deletions(-) diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result index 6cd4c4991b7..84265955dc6 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result @@ -55,7 +55,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = InnoDB, PARTITION `partB` ENGINE = InnoDB, @@ -83,7 +83,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = InnoDB, PARTITION `partB` ENGINE = InnoDB, @@ -111,7 +111,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = InnoDB, PARTITION `partB` ENGINE = InnoDB, @@ -126,7 +126,7 @@ SHOW CREATE TABLE TableB; Table Create Table TableB CREATE TABLE `TableB` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci SELECT PARTITION_NAME, IF(TABLE_ROWS, 'YES', 'NO') AS HAVE_TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME HAVE_TABLE_ROWS parta NO @@ -155,7 +155,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = InnoDB, PARTITION `partB` ENGINE = InnoDB, @@ -191,7 +191,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = InnoDB, @@ -263,7 +263,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = InnoDB, @@ -288,7 +288,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after KEY PARTITIONING test DROP TABLE TableA; # 2.0 HASH partitioning mgm @@ -354,7 +354,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `parta` ENGINE = InnoDB, PARTITION `partB` ENGINE = InnoDB, @@ -382,7 +382,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `parta` ENGINE = InnoDB, PARTITION `partB` ENGINE = InnoDB, @@ -418,7 +418,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = InnoDB, @@ -490,7 +490,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = InnoDB, @@ -515,7 +515,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after HASH PARTITIONING test DROP TABLE TableA; # 3.0 RANGE partitioning mgm @@ -570,7 +570,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION `partB` VALUES LESS THAN (7) ENGINE = InnoDB, @@ -601,7 +601,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION `partB` VALUES LESS THAN (7) ENGINE = InnoDB, @@ -639,7 +639,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION `partD` VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, @@ -712,7 +712,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION `partD` VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, @@ -738,7 +738,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after RANGE PARTITIONING test DROP TABLE TableA; # 4.0 LIST partitioning mgm @@ -793,7 +793,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `parta` VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION `partB` VALUES IN (2,10,11) ENGINE = InnoDB, @@ -824,7 +824,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `parta` VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION `partB` VALUES IN (2,10,11) ENGINE = InnoDB, @@ -862,7 +862,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `Partc` VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION `parta` VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, @@ -927,7 +927,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `Partc` VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION `parta` VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, @@ -951,7 +951,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after LIST PARTITIONING test DROP TABLE TableA; # Testing TRUNCATE PARTITION @@ -970,7 +970,7 @@ t1 CREATE TABLE `t1` ( `a` bigint(20) NOT NULL AUTO_INCREMENT, `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `LT1000` VALUES LESS THAN (1000) ENGINE = InnoDB, PARTITION `LT2000` VALUES LESS THAN (2000) ENGINE = InnoDB, @@ -987,7 +987,6 @@ a b 2001 Second in MAX ALTER TABLE t1 ANALYZE PARTITION MAX; Table Op Msg_type Msg_text -mysql_test_db.t1 analyze status Engine-independent statistics collected mysql_test_db.t1 analyze status OK # Truncate without FLUSH ALTER TABLE t1 TRUNCATE PARTITION MAX; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result index d1b7a599923..5e089f2d2b5 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result @@ -55,7 +55,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MEMORY, PARTITION `partB` ENGINE = MEMORY, @@ -83,7 +83,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MEMORY, PARTITION `partB` ENGINE = MEMORY, @@ -111,7 +111,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MEMORY, PARTITION `partB` ENGINE = MEMORY, @@ -126,7 +126,7 @@ SHOW CREATE TABLE TableB; Table Create Table TableB CREATE TABLE `TableB` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci SELECT PARTITION_NAME, IF(TABLE_ROWS, 'YES', 'NO') AS HAVE_TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME HAVE_TABLE_ROWS parta NO @@ -155,7 +155,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MEMORY, PARTITION `partB` ENGINE = MEMORY, @@ -191,7 +191,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MEMORY, @@ -263,7 +263,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MEMORY, @@ -288,7 +288,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after KEY PARTITIONING test DROP TABLE TableA; # 2.0 HASH partitioning mgm @@ -354,7 +354,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `parta` ENGINE = MEMORY, PARTITION `partB` ENGINE = MEMORY, @@ -382,7 +382,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `parta` ENGINE = MEMORY, PARTITION `partB` ENGINE = MEMORY, @@ -418,7 +418,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MEMORY, @@ -490,7 +490,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MEMORY, @@ -515,7 +515,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after HASH PARTITIONING test DROP TABLE TableA; # 3.0 RANGE partitioning mgm @@ -570,7 +570,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION `partB` VALUES LESS THAN (7) ENGINE = MEMORY, @@ -601,7 +601,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION `partB` VALUES LESS THAN (7) ENGINE = MEMORY, @@ -639,7 +639,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION `partD` VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, @@ -712,7 +712,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION `partD` VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, @@ -738,7 +738,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after RANGE PARTITIONING test DROP TABLE TableA; # 4.0 LIST partitioning mgm @@ -793,7 +793,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `parta` VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION `partB` VALUES IN (2,10,11) ENGINE = MEMORY, @@ -824,7 +824,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `parta` VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION `partB` VALUES IN (2,10,11) ENGINE = MEMORY, @@ -862,7 +862,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `Partc` VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION `parta` VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, @@ -927,7 +927,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `Partc` VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION `parta` VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, @@ -951,7 +951,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after LIST PARTITIONING test DROP TABLE TableA; # Testing TRUNCATE PARTITION @@ -970,7 +970,7 @@ t1 CREATE TABLE `t1` ( `a` bigint(20) NOT NULL AUTO_INCREMENT, `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) -) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 +) ENGINE=MEMORY AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `LT1000` VALUES LESS THAN (1000) ENGINE = MEMORY, PARTITION `LT2000` VALUES LESS THAN (2000) ENGINE = MEMORY, @@ -987,7 +987,6 @@ a b 2001 Second in MAX ALTER TABLE t1 ANALYZE PARTITION MAX; Table Op Msg_type Msg_text -mysql_test_db.t1 analyze status Engine-independent statistics collected mysql_test_db.t1 analyze note The storage engine for the table doesn't support analyze # Truncate without FLUSH ALTER TABLE t1 TRUNCATE PARTITION MAX; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result index ad83e95929a..26f168e3734 100644 --- a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result @@ -55,7 +55,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MyISAM, PARTITION `partB` ENGINE = MyISAM, @@ -83,7 +83,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MyISAM, PARTITION `partB` ENGINE = MyISAM, @@ -111,7 +111,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MyISAM, PARTITION `partB` ENGINE = MyISAM, @@ -126,7 +126,7 @@ SHOW CREATE TABLE TableB; Table Create Table TableB CREATE TABLE `TableB` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci SELECT PARTITION_NAME, IF(TABLE_ROWS, 'YES', 'NO') AS HAVE_TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA ='MySQL_Test_DB' AND TABLE_NAME = 'TableA'; PARTITION_NAME HAVE_TABLE_ROWS parta NO @@ -155,7 +155,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `parta` ENGINE = MyISAM, PARTITION `partB` ENGINE = MyISAM, @@ -191,7 +191,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MyISAM, @@ -263,7 +263,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY KEY (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MyISAM, @@ -288,7 +288,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after KEY PARTITIONING test DROP TABLE TableA; # 2.0 HASH partitioning mgm @@ -354,7 +354,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `parta` ENGINE = MyISAM, PARTITION `partB` ENGINE = MyISAM, @@ -382,7 +382,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `parta` ENGINE = MyISAM, PARTITION `partB` ENGINE = MyISAM, @@ -418,7 +418,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MyISAM, @@ -490,7 +490,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY HASH (`a`) (PARTITION `partB` COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION `parta` COMMENT = 'Previusly named partB' ENGINE = MyISAM, @@ -515,7 +515,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after HASH PARTITIONING test DROP TABLE TableA; # 3.0 RANGE partitioning mgm @@ -570,7 +570,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION `partB` VALUES LESS THAN (7) ENGINE = MyISAM, @@ -601,7 +601,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION `partB` VALUES LESS THAN (7) ENGINE = MyISAM, @@ -639,7 +639,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION `partD` VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, @@ -712,7 +712,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `parta` VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION `partD` VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, @@ -738,7 +738,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after RANGE PARTITIONING test DROP TABLE TableA; # 4.0 LIST partitioning mgm @@ -793,7 +793,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `parta` VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION `partB` VALUES IN (2,10,11) ENGINE = MyISAM, @@ -824,7 +824,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `parta` VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION `partB` VALUES IN (2,10,11) ENGINE = MyISAM, @@ -862,7 +862,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `Partc` VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION `parta` VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, @@ -927,7 +927,7 @@ SHOW CREATE TABLE tablea; Table Create Table tablea CREATE TABLE `tablea` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY LIST (`a`) (PARTITION `Partc` VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION `parta` VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, @@ -951,7 +951,7 @@ SHOW CREATE TABLE TableA; Table Create Table TableA CREATE TABLE `TableA` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci # Cleaning up after LIST PARTITIONING test DROP TABLE TableA; # Testing TRUNCATE PARTITION @@ -970,7 +970,7 @@ t1 CREATE TABLE `t1` ( `a` bigint(20) NOT NULL AUTO_INCREMENT, `b` varchar(255) DEFAULT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 +) ENGINE=MyISAM AUTO_INCREMENT=2002 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PARTITION BY RANGE (`a`) (PARTITION `LT1000` VALUES LESS THAN (1000) ENGINE = MyISAM, PARTITION `LT2000` VALUES LESS THAN (2000) ENGINE = MyISAM, @@ -987,7 +987,6 @@ a b 2001 Second in MAX ALTER TABLE t1 ANALYZE PARTITION MAX; Table Op Msg_type Msg_text -mysql_test_db.t1 analyze status Engine-independent statistics collected mysql_test_db.t1 analyze status OK # Truncate without FLUSH ALTER TABLE t1 TRUNCATE PARTITION MAX; From 28463b2824eadca343d1951b956366b44793384f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 12 Dec 2024 09:28:49 +0200 Subject: [PATCH 2/9] TODO-5067 : Add test case for Galera library protocol versions This version of test requires Galera library 26.4.21 to work. Signed-off-by: Julius Goryavsky --- .../suite/wsrep/r/wsrep_protocol_versions.result | 7 +++++++ .../suite/wsrep/t/wsrep_protocol_versions.cnf | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 mysql-test/suite/wsrep/r/wsrep_protocol_versions.result create mode 100644 mysql-test/suite/wsrep/t/wsrep_protocol_versions.cnf diff --git a/mysql-test/suite/wsrep/r/wsrep_protocol_versions.result b/mysql-test/suite/wsrep/r/wsrep_protocol_versions.result new file mode 100644 index 00000000000..35139f5b9cf --- /dev/null +++ b/mysql-test/suite/wsrep/r/wsrep_protocol_versions.result @@ -0,0 +1,7 @@ +# Correct Galera library found +show status like 'wsrep_protocol%'; +Variable_name Value +wsrep_protocol_application 4 +wsrep_protocol_gcs 5 +wsrep_protocol_replicator 11 +wsrep_protocol_version 11 diff --git a/mysql-test/suite/wsrep/t/wsrep_protocol_versions.cnf b/mysql-test/suite/wsrep/t/wsrep_protocol_versions.cnf new file mode 100644 index 00000000000..f4d5689404c --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_protocol_versions.cnf @@ -0,0 +1,13 @@ +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld.1] +wsrep-on=ON +binlog-format=ROW +innodb-flush-log-at-trx-commit=1 +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +innodb-autoinc-lock-mode=2 +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port From ee2dc336d7e22df6feec96481dd075ab1d16359b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 12 Dec 2024 12:22:53 +0200 Subject: [PATCH 3/9] TODO-5067 addendum : Add test case for Galera library protocol versions Add missing file Signed-off-by: Julius Goryavsky --- mysql-test/suite/wsrep/t/wsrep_protocol_versions.test | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mysql-test/suite/wsrep/t/wsrep_protocol_versions.test diff --git a/mysql-test/suite/wsrep/t/wsrep_protocol_versions.test b/mysql-test/suite/wsrep/t/wsrep_protocol_versions.test new file mode 100644 index 00000000000..f8979050686 --- /dev/null +++ b/mysql-test/suite/wsrep/t/wsrep_protocol_versions.test @@ -0,0 +1,9 @@ +--source include/have_wsrep.inc +--source include/force_restart.inc +--source include/have_innodb.inc + +--let $galera_version=26.4.21 +source include/check_galera_version.inc; + +--sorted_result +show status like 'wsrep_protocol%'; From d72c5d1ace69b4506b8761508bf03bed48ade5a5 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Tue, 10 Dec 2024 15:08:38 +0100 Subject: [PATCH 4/9] Fixup for MDEV-35446 The previous commit for fixing MDEV-35446 disabled setting Galera errors on COM_STMT_PREPARE commands. As a side effect, a number of tests were started to fail due to the client receiving different error codes from the ones expected in the test dependending on whether --ps-protocol was used. Also, in the case of test galera_ftwrl, it was found that it is expected that during COM_STMT_PREPARE command, we may perform a sync wait operation, which can fail with LOCK_WAIT_TIMEOUT error. The revised fix consists in anticipating the call to wsrep_after_command_before_result(), so that we check for BF aborts or errors during statement prepare, before sending back the statement metadata message to client. Signed-off-by: Julius Goryavsky --- sql/sql_parse.cc | 25 +++++++++++++++++-------- sql/sql_prepare.cc | 10 ++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e7699a3f464..319d5e6535b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1165,8 +1165,7 @@ static bool wsrep_command_no_result(char command) { return (command == COM_STMT_FETCH || command == COM_STMT_SEND_LONG_DATA || - command == COM_STMT_CLOSE || - command == COM_STMT_PREPARE); + command == COM_STMT_CLOSE); } #endif /* WITH_WSREP */ #ifndef EMBEDDED_LIBRARY @@ -2444,13 +2443,23 @@ dispatch_end: { DEBUG_SYNC(thd, "wsrep_at_dispatch_end_before_result"); } - wsrep_after_command_before_result(thd); - if (wsrep_current_error(thd) && !wsrep_command_no_result(command)) + if (thd->wsrep_cs().state() == wsrep::client_state::s_exec) { - /* todo: Pass wsrep client state current error to override */ - wsrep_override_error(thd, wsrep_current_error(thd), - wsrep_current_error_status(thd)); - WSREP_LOG_THD(thd, "leave"); + wsrep_after_command_before_result(thd); + if (wsrep_current_error(thd) && !wsrep_command_no_result(command)) + { + /* todo: Pass wsrep client state current error to override */ + wsrep_override_error(thd, wsrep_current_error(thd), + wsrep_current_error_status(thd)); + WSREP_LOG_THD(thd, "leave"); + } + } + else + { + /* wsrep_after_command_before_result() already called elsewhere + or not necessary to call it */ + assert(thd->wsrep_cs().state() == wsrep::client_state::s_none || + thd->wsrep_cs().state() == wsrep::client_state::s_result); } if (WSREP(thd)) { diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 3d7dda16643..93e81b2025d 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2355,6 +2355,16 @@ static bool check_prepared_statement(Prepared_statement *stmt) #ifdef WITH_WSREP if (wsrep_sync_wait(thd, sql_command)) goto error; + if (!stmt->is_sql_prepare()) + { + wsrep_after_command_before_result(thd); + if (wsrep_current_error(thd)) + { + wsrep_override_error(thd, wsrep_current_error(thd), + wsrep_current_error_status(thd)); + goto error; + } + } #endif switch (sql_command) { case SQLCOM_REPLACE: From 75dd0246f8b0b7c1d7d7762415089a74c433cb1d Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Wed, 11 Dec 2024 17:35:53 +0100 Subject: [PATCH 5/9] Remove error handling from wsrep_sync_wait() Let the wsrep-lib error be set/overriden at the end of dispatch_command(). Signed-off-by: Julius Goryavsky --- sql/wsrep_mysqld.cc | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 4a2c439cb43..6c4fd8c950a 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1231,35 +1231,7 @@ bool wsrep_sync_wait (THD* thd, uint mask) This allows autocommit SELECTs and a first SELECT after SET AUTOCOMMIT=0 TODO: modify to check if thd has locked any rows. */ - if (thd->wsrep_cs().sync_wait(-1)) - { - const char* msg; - int err; - - /* - Possibly relevant error codes: - ER_CHECKREAD, ER_ERROR_ON_READ, ER_INVALID_DEFAULT, ER_EMPTY_QUERY, - ER_FUNCTION_NOT_DEFINED, ER_NOT_ALLOWED_COMMAND, ER_NOT_SUPPORTED_YET, - ER_FEATURE_DISABLED, ER_QUERY_INTERRUPTED - */ - - switch (thd->wsrep_cs().current_error()) - { - case wsrep::e_not_supported_error: - msg= "synchronous reads by wsrep backend. " - "Please unset wsrep_causal_reads variable."; - err= ER_NOT_SUPPORTED_YET; - break; - default: - msg= "Synchronous wait failed."; - err= ER_LOCK_WAIT_TIMEOUT; // NOTE: the above msg won't be displayed - // with ER_LOCK_WAIT_TIMEOUT - } - - my_error(err, MYF(0), msg); - - return true; - } + return thd->wsrep_cs().sync_wait(-1); } return false; From eadf96cea4a572807bf46d179ab13ee69518b0e1 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Thu, 10 Oct 2024 14:28:49 +0200 Subject: [PATCH 6/9] MDEV-26266 Update wsrep-lib Update wsrep-lib to fix the issue and add the MTR test case from the ticket. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/MDEV-26266.result | 23 ++++++++++++++ mysql-test/suite/galera/t/MDEV-26266.test | 35 +++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 mysql-test/suite/galera/r/MDEV-26266.result create mode 100644 mysql-test/suite/galera/t/MDEV-26266.test diff --git a/mysql-test/suite/galera/r/MDEV-26266.result b/mysql-test/suite/galera/r/MDEV-26266.result new file mode 100644 index 00000000000..01171d4bb83 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-26266.result @@ -0,0 +1,23 @@ +connection node_2; +connection node_1; +SET SESSION query_prealloc_size=8192; +SET max_session_mem_used=50000; +CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=InnoDB ; +UPDATE t1 SET c1='1'; +ERROR HY000: The MariaDB server is running with the --max-session-mem-used=50000 option so it cannot execute this statement +SET wsrep_trx_fragment_size=1; +SET SESSION AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +SET @inserted_value=REPEAT ('z', 257); +CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB ; +SELECT * FROM t1 WHERE c1='two'; +ERROR HY000: The MariaDB server is running with the --max-session-mem-used=50000 option so it cannot execute this statement +UPDATE t1 SET c1='2'; +INSERT INTO t2 VALUES (2); +ERROR HY000: The MariaDB server is running with the --max-session-mem-used=50000 option so it cannot execute this statement +INSERT INTO t2 VALUES (3); +INSERT INTO t2 VALUES (4); +INSERT INTO t2 VALUES (5); +CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 IN (SELECT a FROM t2) GROUP BY c1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1,t2; diff --git a/mysql-test/suite/galera/t/MDEV-26266.test b/mysql-test/suite/galera/t/MDEV-26266.test new file mode 100644 index 00000000000..7167e029cb5 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-26266.test @@ -0,0 +1,35 @@ +# +# MDEV-26266 - Assertion +# state() == s_preparing || +# (is_xa() && state() == s_replaying) || +# (ret && (state() == s_must_abort || +# state() == s_must_replay || +# state() == s_cert_failed || +# state() == s_aborted)) +# failed. +# + +--source include/galera_cluster.inc + +SET SESSION query_prealloc_size=8192; +SET max_session_mem_used=50000; +CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=InnoDB ; +--error ER_OPTION_PREVENTS_STATEMENT +UPDATE t1 SET c1='1'; +SET wsrep_trx_fragment_size=1; +SET SESSION AUTOCOMMIT=0; +INSERT INTO t1 VALUES (1); +SET @inserted_value=REPEAT ('z', 257); +CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB ; +--error ER_OPTION_PREVENTS_STATEMENT +SELECT * FROM t1 WHERE c1='two'; +UPDATE t1 SET c1='2'; +--error ER_OPTION_PREVENTS_STATEMENT +INSERT INTO t2 VALUES (2); +INSERT INTO t2 VALUES (3); +INSERT INTO t2 VALUES (4); +INSERT INTO t2 VALUES (5); +--error ER_LOCK_DEADLOCK +CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 IN (SELECT a FROM t2) GROUP BY c1; + +DROP TABLE t1,t2; From c93ffd5e583d7f15b095106eba0306f9f65e3f54 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 17 Dec 2024 09:53:19 +0100 Subject: [PATCH 7/9] galera: wsrep-lib submodule update --- wsrep-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsrep-lib b/wsrep-lib index 1c61b809d1e..70cd967f5e2 160000 --- a/wsrep-lib +++ b/wsrep-lib @@ -1 +1 @@ -Subproject commit 1c61b809d1e1d03771dcad689d3a084e17c6b6c3 +Subproject commit 70cd967f5e249b53d6cce90e2e4198641c564381 From 7b0f59da43b4967e49333d0bf7b793ee66fe16cd Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 17 Dec 2024 09:56:54 +0100 Subject: [PATCH 8/9] wsrep mtr suite: update for galera library 26.4.21 --- mysql-test/suite/wsrep/r/variables.result | 3 +++ mysql-test/suite/wsrep/r/variables_debug.result | 3 +++ mysql-test/suite/wsrep/t/variables.test | 2 +- mysql-test/suite/wsrep/t/variables_debug.test | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result index c21e4dc0323..73cc5afc559 100644 --- a/mysql-test/suite/wsrep/r/variables.result +++ b/mysql-test/suite/wsrep/r/variables.result @@ -3,6 +3,9 @@ SHOW GLOBAL STATUS LIKE 'wsrep%'; Variable_name Value wsrep_local_state_uuid # wsrep_protocol_version # +wsrep_protocol_application # +wsrep_protocol_replicator # +wsrep_protocol_gcs # wsrep_last_committed # wsrep_replicated # wsrep_replicated_bytes # diff --git a/mysql-test/suite/wsrep/r/variables_debug.result b/mysql-test/suite/wsrep/r/variables_debug.result index 65f5b0ee274..f9f8a736d8d 100644 --- a/mysql-test/suite/wsrep/r/variables_debug.result +++ b/mysql-test/suite/wsrep/r/variables_debug.result @@ -3,6 +3,9 @@ SHOW GLOBAL STATUS LIKE 'wsrep%'; Variable_name Value wsrep_local_state_uuid # wsrep_protocol_version # +wsrep_protocol_application # +wsrep_protocol_replicator # +wsrep_protocol_gcs # wsrep_last_committed # wsrep_replicated # wsrep_replicated_bytes # diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test index e40ac7b8772..3f3363d8f26 100644 --- a/mysql-test/suite/wsrep/t/variables.test +++ b/mysql-test/suite/wsrep/t/variables.test @@ -3,7 +3,7 @@ --source include/have_innodb.inc --source include/galera_no_debug_sync.inc ---let $galera_version=26.4.9 +--let $galera_version=26.4.21 source include/check_galera_version.inc; source include/galera_variables_ok.inc; diff --git a/mysql-test/suite/wsrep/t/variables_debug.test b/mysql-test/suite/wsrep/t/variables_debug.test index 29747e48f18..4d0de10ed0a 100644 --- a/mysql-test/suite/wsrep/t/variables_debug.test +++ b/mysql-test/suite/wsrep/t/variables_debug.test @@ -5,7 +5,7 @@ --source include/have_debug_sync.inc --source include/galera_have_debug_sync.inc ---let $galera_version=26.4.9 +--let $galera_version=26.4.21 source include/check_galera_version.inc; source include/galera_variables_ok.inc; From a226f12675c6312ca7632b90261397e313e6a7ae Mon Sep 17 00:00:00 2001 From: Dave Gosselin Date: Thu, 5 Dec 2024 09:36:52 -0500 Subject: [PATCH 9/9] MDEV-35578 innodb_gis.rtree_debug fails on mac strerror_s on Linux will, for unknown error codes, display 'Unknown error ' and our tests are written with this assumption. However, on macOS, sterror_s returns 'Unknown error: ' in the same case, which breaks tests. Make my_strerror consistent across the platforms by removing the ':' when present. --- strings/my_vsnprintf.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 8b4dc5da561..e072ff880f5 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -860,6 +860,27 @@ int my_fprintf(FILE *stream, const char* format, ...) } +#ifdef __APPLE__ +/* Delete the ':' character added by Apple's implementation of strerror_r */ +static void delete_colon_char(char *buf) +{ + static const char *unknown_err= "Unknown error"; + static const size_t unknown_err_len= 13; + char *ptr= strstr(buf, unknown_err); + char *src= NULL; + if (ptr) { + ptr+= unknown_err_len; + if (*ptr == ':') { + // just overwrite the colon by shifting everything down by one, + // e.g. "Unknown error: 1000" becomes "Unknown error 1000" + src= ptr + 1; + memmove(ptr, src, strlen(src) + 1); // include null + } + } +} +#endif + + /* Return system error text for given error number @@ -913,6 +934,10 @@ const char* my_strerror(char *buf, size_t len, int nr) #else strerror_r(nr, buf, len); #endif + +#ifdef __APPLE__ + delete_colon_char(buf); +#endif } /*