MDEV-33979 Disallow bulk insert operation during partition update statement

Problem:
========
- Partition update operation enables the bulk insert for the
transaction while moving the row between partitions. This leads
to debug assert failure while removing the row from one
of the partition.

Solution:
========
- Disallow the bulk insert operation for non-insert operation
of partition table.
parent 0ccdf54b
......@@ -251,4 +251,13 @@ c1
1984
3331
DROP TABLE t1;
#
# MDEV-33979 Disallow bulk insert operation during
# partition update statement
#
CREATE TABLE t1(a INT KEY)ENGINE=InnoDB
PARTITION BY KEY(a) PARTITIONS 16;
INSERT INTO t1 VALUES(1);
UPDATE t1 SET a = 2 WHERE a = 1;
DROP TABLE t1;
# End of 10.6 tests
......@@ -269,4 +269,14 @@ connection default;
disconnect con1;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-33979 Disallow bulk insert operation during
--echo # partition update statement
--echo #
CREATE TABLE t1(a INT KEY)ENGINE=InnoDB
PARTITION BY KEY(a) PARTITIONS 16;
INSERT INTO t1 VALUES(1);
UPDATE t1 SET a = 2 WHERE a = 1;
DROP TABLE t1;
--echo # End of 10.6 tests
......@@ -8776,6 +8776,7 @@ ha_innobase::delete_row(
: PLAIN_DELETE;
trx->fts_next_doc_id = 0;
ut_ad(!trx->is_bulk_insert());
error = row_update_for_mysql(m_prebuilt);
#ifdef WITH_WSREP
......
......@@ -2708,7 +2708,9 @@ row_ins_clust_index_entry_low(
&& !index->table->skip_alter_undo
&& !index->table->n_rec_locks
&& !index->table->is_active_ddl()
&& !index->table->versioned()) {
&& !index->table->versioned()
&& (!dict_table_is_partition(index->table)
|| thd_sql_command(trx->mysql_thd) == SQLCOM_INSERT)) {
DEBUG_SYNC_C("empty_root_page_insert");
if (!index->table->is_temporary()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment