diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result index c92778f5a4c..b35b508fa7f 100644 --- a/mysql-test/suite/innodb/r/insert_into_empty.result +++ b/mysql-test/suite/innodb/r/insert_into_empty.result @@ -174,3 +174,11 @@ COMMIT; SET autocommit=1; DROP TABLE t1; DROP TEMPORARY TABLE t0; +# +# MDEV-25496 Assertion 'trx->bulk_insert' failed +# in trx_undo_report_row_operation on INSERT +# +CREATE TABLE t (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2; +INSERT INTO t VALUES (0); +INSERT INTO t VALUES (1),(0),(1); +DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test index 87da67dc0c5..8b885cb5b4f 100644 --- a/mysql-test/suite/innodb/t/insert_into_empty.test +++ b/mysql-test/suite/innodb/t/insert_into_empty.test @@ -1,6 +1,7 @@ --source include/have_innodb.inc --source include/have_sequence.inc --source include/maybe_debug.inc +--source include/have_partition.inc # Enable MDEV-515 table-level undo logging for insert into empty table SET foreign_key_checks=0, unique_checks=0; @@ -183,3 +184,12 @@ COMMIT; SET autocommit=1; DROP TABLE t1; DROP TEMPORARY TABLE t0; + +--echo # +--echo # MDEV-25496 Assertion 'trx->bulk_insert' failed +--echo # in trx_undo_report_row_operation on INSERT +--echo # +CREATE TABLE t (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2; +INSERT INTO t VALUES (0); +INSERT INTO t VALUES (1),(0),(1); +DROP TABLE t; diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 4adc279fb32..bb85e82cbb8 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1051,13 +1051,6 @@ row_get_prebuilt_insert_row( if (prebuilt->trx_id == table->def_trx_id && prebuilt->ins_node->entry_list.size() == UT_LIST_GET_LEN(table->indexes)) { - - if (prebuilt->trx->bulk_insert - && prebuilt->ins_node->trx_id - != prebuilt->trx->id) { - prebuilt->trx->bulk_insert = false; - } - return(prebuilt->ins_node->row); }