mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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
The bug is caused by a similar mechanism as MDEV-21027. The function, check_insert_or_replace_autoincrement, failed to open all the partitions on REPLACE SELECT statements and it results in the assertion error.
This commit is contained in:
parent
a59dffb0e9
commit
2beede9ba4
8 changed files with 87 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue