diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result index 2219b6f3c31..429f8d0044a 100644 --- a/mysql-test/suite/innodb/r/insert_into_empty.result +++ b/mysql-test/suite/innodb/r/insert_into_empty.result @@ -488,4 +488,16 @@ BEGIN; LOAD DATA INFILE 'VARDIR/tmp/t.outfile' INTO TABLE t; COMMIT; DROP TABLE t; +# +# MDEV-33934 Assertion `!check_foreigns' failed in +# trx_t::bulk_insert_apply_for_table(dict_table_t*) +# +CREATE TABLE t1(f1 INT,f2 INT,KEY(f1))engine=innodb; +BEGIN; +INSERT INTO t1 VALUES(); +SET STATEMENT FOREIGN_KEY_CHECKS=1 FOR SELECT * FROM t1; +f1 f2 +NULL NULL +COMMIT; +DROP TABLE t1; # End of 10.11 tests diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test index 88ee2b53697..736eca18d7c 100644 --- a/mysql-test/suite/innodb/t/insert_into_empty.test +++ b/mysql-test/suite/innodb/t/insert_into_empty.test @@ -523,4 +523,15 @@ eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t.outfile' INTO TABLE t; COMMIT; DROP TABLE t; --remove_file $MYSQLTEST_VARDIR/tmp/t.outfile + +--echo # +--echo # MDEV-33934 Assertion `!check_foreigns' failed in +--echo # trx_t::bulk_insert_apply_for_table(dict_table_t*) +--echo # +CREATE TABLE t1(f1 INT,f2 INT,KEY(f1))engine=innodb; +BEGIN; +INSERT INTO t1 VALUES(); +SET STATEMENT FOREIGN_KEY_CHECKS=1 FOR SELECT * FROM t1; +COMMIT; +DROP TABLE t1; --echo # End of 10.11 tests diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 465a5965b6c..bcb93970ffc 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -5373,8 +5373,6 @@ dberr_t trx_t::bulk_insert_apply_for_table(dict_table_t *table) { if (UNIV_UNLIKELY(!bulk_insert)) return DB_SUCCESS; - ut_ad(!check_unique_secondary); - ut_ad(!check_foreigns); auto it= mod_tables.find(table); if (it != mod_tables.end() && it->second.bulk_store) if (dberr_t err= it->second.write_bulk(table, this))