diff options
8 files changed, 87 insertions, 1 deletions
diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc index fcfd5bce746..974e4fe559d 100644 --- a/mysql-test/suite/parts/inc/partition_auto_increment.inc +++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc @@ -873,6 +873,19 @@ eval CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=$ INSERT INTO t1 VALUES (1,1),(2,2); UPDATE t1 SET pk = 0; DROP TABLE t1; + +--echo # +--echo # MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' +--echo # failed in ha_partition::set_auto_increment_if_higher upon REPLACE +--echo # with partition pruning +--echo # +eval CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine +PARTITION BY RANGE (a) ( + PARTITION p0 VALUES LESS THAN (10), + PARTITION pn VALUES LESS THAN MAXVALUE +); +REPLACE INTO t1 PARTITION (p0) SELECT 1; +DROP TABLE t1; } if (!$skip_delete) diff --git a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result index 94e4a64ab6a..8c82541b988 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result @@ -704,6 +704,18 @@ INSERT INTO t1 VALUES (1,1),(2,2); UPDATE t1 SET pk = 0; DROP TABLE t1; # +# MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' +# failed in ha_partition::set_auto_increment_if_higher upon REPLACE +# with partition pruning +# +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Blackhole' +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION pn VALUES LESS THAN MAXVALUE +); +REPLACE INTO t1 PARTITION (p0) SELECT 1; +DROP TABLE t1; +# # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' # ha_partition::set_auto_increment_if_higher # diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result index a10eee73a2e..48b0d06575a 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result @@ -1111,6 +1111,18 @@ INSERT INTO t1 VALUES (1,1),(2,2); UPDATE t1 SET pk = 0; DROP TABLE t1; # +# MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' +# failed in ha_partition::set_auto_increment_if_higher upon REPLACE +# with partition pruning +# +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='InnoDB' +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION pn VALUES LESS THAN MAXVALUE +); +REPLACE INTO t1 PARTITION (p0) SELECT 1; +DROP TABLE t1; +# # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' # ha_partition::set_auto_increment_if_higher # diff --git a/mysql-test/suite/parts/r/partition_auto_increment_maria.result b/mysql-test/suite/parts/r/partition_auto_increment_maria.result index d9bc3b77ed5..3767a278503 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_maria.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_maria.result @@ -1158,6 +1158,18 @@ INSERT INTO t1 VALUES (1,1),(2,2); UPDATE t1 SET pk = 0; DROP TABLE t1; # +# MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' +# failed in ha_partition::set_auto_increment_if_higher upon REPLACE +# with partition pruning +# +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Aria' +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION pn VALUES LESS THAN MAXVALUE +); +REPLACE INTO t1 PARTITION (p0) SELECT 1; +DROP TABLE t1; +# # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' # ha_partition::set_auto_increment_if_higher # diff --git a/mysql-test/suite/parts/r/partition_auto_increment_memory.result b/mysql-test/suite/parts/r/partition_auto_increment_memory.result index c265ffeeed6..936e3e9e1cb 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_memory.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_memory.result @@ -1139,6 +1139,18 @@ INSERT INTO t1 VALUES (1,1),(2,2); UPDATE t1 SET pk = 0; DROP TABLE t1; # +# MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' +# failed in ha_partition::set_auto_increment_if_higher upon REPLACE +# with partition pruning +# +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Memory' +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION pn VALUES LESS THAN MAXVALUE +); +REPLACE INTO t1 PARTITION (p0) SELECT 1; +DROP TABLE t1; +# # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' # ha_partition::set_auto_increment_if_higher # diff --git a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result index a0befe8ef2c..475533ceb76 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result @@ -1158,6 +1158,18 @@ INSERT INTO t1 VALUES (1,1),(2,2); UPDATE t1 SET pk = 0; DROP TABLE t1; # +# MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' +# failed in ha_partition::set_auto_increment_if_higher upon REPLACE +# with partition pruning +# +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='MyISAM' +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION pn VALUES LESS THAN MAXVALUE +); +REPLACE INTO t1 PARTITION (p0) SELECT 1; +DROP TABLE t1; +# # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' # ha_partition::set_auto_increment_if_higher # diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 5d1ca70d3a9..eee73451cdc 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1410,7 +1410,8 @@ private: if (!part_share->auto_inc_initialized && (ha_thd()->lex->sql_command == SQLCOM_INSERT || ha_thd()->lex->sql_command == SQLCOM_INSERT_SELECT || - ha_thd()->lex->sql_command == SQLCOM_REPLACE) && + ha_thd()->lex->sql_command == SQLCOM_REPLACE || + ha_thd()->lex->sql_command == SQLCOM_REPLACE_SELECT) && table->found_next_number_field) bitmap_set_all(&m_part_info->read_partitions); } diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result index b111de8f344..543cc0e1122 100644 --- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result +++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result @@ -1125,6 +1125,18 @@ INSERT INTO t1 VALUES (1,1),(2,2); UPDATE t1 SET pk = 0; DROP TABLE t1; # +# MDEV-29636 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' +# failed in ha_partition::set_auto_increment_if_higher upon REPLACE +# with partition pruning +# +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='TokuDB' +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION pn VALUES LESS THAN MAXVALUE +); +REPLACE INTO t1 PARTITION (p0) SELECT 1; +DROP TABLE t1; +# # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' # ha_partition::set_auto_increment_if_higher # |