From e04bbf73dc372917cbcdaa965fdc69e8b575d75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 28 Jun 2021 17:10:09 +0300 Subject: [PATCH] MDEV-25496 Assertion 'trx->bulk_insert' failed on INSERT row_get_prebuilt_insert_row(): Remove some fallback code that had been added in commit 8ea923f55b7666a359ac2c54f6c10e8609d16846 (MDEV-24818). It seems that after all, statement boundaries are being reliably indicated by ha_innobase::start_stmt() or (for partitioned tables) ha_innobase::external_lock(). --- mysql-test/suite/innodb/r/insert_into_empty.result | 8 ++++++++ mysql-test/suite/innodb/t/insert_into_empty.test | 10 ++++++++++ storage/innobase/row/row0mysql.cc | 7 ------- 3 files changed, 18 insertions(+), 7 deletions(-) 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); }