diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result index cc532de90ab..73bda29341e 100644 --- a/mysql-test/suite/innodb/r/insert_into_empty.result +++ b/mysql-test/suite/innodb/r/insert_into_empty.result @@ -281,3 +281,18 @@ c SELECT * FROM t2; c DROP TABLE t2, t1; +# +# MDEV-28242 Assertion `!check_foreigns' failed in +# trx_t::check_bulk_buffer +# +CREATE TABLE t1 (c INT)ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES(1), (1); +SET SESSION foreign_key_checks=TRUE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CREATE TABLE t2(d INT)ENGINE=InnoDB; +DROP TABLE t2, t1; diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test index 0af5a9b97ba..717787e41fa 100644 --- a/mysql-test/suite/innodb/t/insert_into_empty.test +++ b/mysql-test/suite/innodb/t/insert_into_empty.test @@ -292,3 +292,15 @@ INSERT INTO t1 VALUES (0); SELECT * FROM t1; SELECT * FROM t2; DROP TABLE t2, t1; + +--echo # +--echo # MDEV-28242 Assertion `!check_foreigns' failed in +--echo # trx_t::check_bulk_buffer +--echo # +CREATE TABLE t1 (c INT)ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES(1), (1); +SET SESSION foreign_key_checks=TRUE; +SHOW CREATE TABLE t1; +CREATE TABLE t2(d INT)ENGINE=InnoDB; +DROP TABLE t2, t1; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index faccc83cef4..cc02b2fa65c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3801,8 +3801,6 @@ static ulonglong innodb_prepare_commit_versioned(THD* thd, ulonglong *trx_id) if (t.second.is_bulk_insert()) { ut_ad(trx->bulk_insert); - ut_ad(!trx->check_unique_secondary); - ut_ad(!trx->check_foreigns); if (t.second.write_bulk(t.first, trx)) return ULONGLONG_MAX; }