SET unique_checks=0,foreign_key_checks=0,autocommit=0;
|
CREATE TABLE t (c CHAR(1));
|
INSERT INTO t VALUES();
|
SET SESSION foreign_key_checks=TRUE;
|
CREATE TEMPORARY SEQUENCE s1;
|
Leads to:
10.9.0 5be92887c2caacb45af87b1131db952ce627e83a (Debug)
|
mysqld: /test/10.9_dbg/storage/innobase/include/trx0trx.h:1115: trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*): Assertion `!check_foreigns' failed.
|
10.9.0 5be92887c2caacb45af87b1131db952ce627e83a (Debug)
|
Core was generated by `/test/MD160322-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
[Current thread is 1 (Thread 0x153d88165700 (LWP 3647790))]
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#1 0x0000153da6dfb859 in __GI_abort () at abort.c:79
|
#2 0x0000153da6dfb729 in __assert_fail_base (fmt=0x153da6f91588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x558b9310ab41 "!check_foreigns", file=0x558b931101f8 "/test/10.9_dbg/storage/innobase/include/trx0trx.h", line=1115, function=<optimized out>) at assert.c:92
|
#3 0x0000153da6e0d006 in __GI___assert_fail (assertion=assertion@entry=0x558b9310ab41 "!check_foreigns", file=file@entry=0x558b931101f8 "/test/10.9_dbg/storage/innobase/include/trx0trx.h", line=line@entry=1115, function=function@entry=0x558b9314a778 "trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*)") at assert.c:101
|
#4 0x0000558b929fb227 in trx_t::check_bulk_buffer (table=<optimized out>, this=0x153d9dc331e0) at /test/10.9_dbg/storage/innobase/include/trx0trx.h:1115
|
#5 row_ins_index_entry (thr=0x153d18074f00, entry=0x153d18023858, index=0x153d18072888) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3379
|
#6 row_ins_index_entry_step (thr=0x153d18074f00, node=0x153d18074c08) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3556
|
#7 row_ins (thr=0x153d18074f00, node=0x153d18074c08) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3702
|
#8 row_ins_step (thr=thr@entry=0x153d18074f00) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3848
|
#9 0x0000558b92a1f578 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x153d180710d8 "\377\001", prebuilt=0x153d180745c8, ins_mode=ROW_INS_NORMAL) at /test/10.9_dbg/storage/innobase/row/row0mysql.cc:1318
|
#10 0x0000558b928993c5 in ha_innobase::write_row (this=0x153d18073040, record=0x153d180710d8 "\377\001") at /test/10.9_dbg/storage/innobase/handler/ha_innodb.cc:7800
|
#11 0x0000558b92837350 in ha_sequence::write_row (this=0x153d18071560, buf=0x153d180710d8 "\377\001") at /test/10.9_dbg/sql/ha_sequence.cc:223
|
#12 0x0000558b924f2601 in handler::ha_write_row (this=0x153d18071560, buf=0x153d180710d8 "\377\001") at /test/10.9_dbg/sql/handler.cc:7527
|
#13 0x0000558b9242a4ca in sequence_definition::write_initial_sequence (this=this@entry=0x153d180145c0, table=0x153d18070c88) at /test/10.9_dbg/sql/sql_sequence.cc:617
|
#14 0x0000558b9242a6bf in sequence_insert (thd=thd@entry=0x153d18000db8, lex=0x153d180050f0, org_table_list=org_table_list@entry=0x153d18013ed8) at /test/10.9_dbg/sql/sql_sequence.cc:367
|
#15 0x0000558b922c389a in mysql_create_table_no_lock (thd=thd@entry=0x153d18000db8, ddl_log_state_create=ddl_log_state_create@entry=0x153d88163920, ddl_log_state_rm=ddl_log_state_rm@entry=0x153d88163940, db=db@entry=0x153d18013ef0, table_name=table_name@entry=0x153d18013f00, create_info=create_info@entry=0x153d88163bc0, alter_info=0x153d88163ad0, is_trans=0x153d8816391f, create_table_mode=0, table_list=0x153d18013ed8) at /test/10.9_dbg/sql/sql_table.cc:4724
|
#16 0x0000558b922c3c5e in mysql_create_table (thd=thd@entry=0x153d18000db8, create_table=create_table@entry=0x153d18013ed8, create_info=create_info@entry=0x153d88163bc0, alter_info=alter_info@entry=0x153d88163ad0) at /test/10.9_dbg/sql/sql_table.cc:4822
|
#17 0x0000558b922c5b16 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x153d18000db8) at /test/10.9_dbg/sql/sql_table.cc:12325
|
#18 0x0000558b921de930 in mysql_execute_command (thd=thd@entry=0x153d18000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:5988
|
#19 0x0000558b921c5437 in mysql_parse (thd=thd@entry=0x153d18000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153d88164400) at /test/10.9_dbg/sql/sql_parse.cc:8027
|
#20 0x0000558b921d40d3 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153d18000db8, packet=packet@entry=0x153d1800b889 "CREATE TEMPORARY SEQUENCE s1", packet_length=packet_length@entry=28, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362
|
#21 0x0000558b921d751a in do_command (thd=0x153d18000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1402
|
#22 0x0000558b92352228 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x558b953407a8, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
|
#23 0x0000558b9235282d in handle_one_connection (arg=arg@entry=0x558b953407a8) at /test/10.9_dbg/sql/sql_connect.cc:1312
|
#24 0x0000558b927d8f23 in pfs_spawn_thread (arg=0x558b952539c8) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201
|
#25 0x0000153da730c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#26 0x0000153da6ef8163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.7.4 (dbg), 10.8.3 (dbg), 10.9.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (opt), 10.8.3 (opt), 10.9.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)
{"report":{"fcp":1204.0999999046326,"ttfb":398.5,"pageVisibility":"visible","entityId":109464,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"2dbcb40b-ff66-4977-81a1-d474e46063c5","navigationType":0,"readyForUser":1373.9000000953674,"redirectCount":0,"resourceLoadedEnd":1210.5999999046326,"resourceLoadedStart":406.80000019073486,"resourceTiming":[{"duration":44.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":406.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":406.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":451.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":45.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":407.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":407.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":452.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":236,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":407.30000019073486,"connectEnd":407.30000019073486,"connectStart":407.30000019073486,"domainLookupEnd":407.30000019073486,"domainLookupStart":407.30000019073486,"fetchStart":407.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":478.90000009536743,"responseEnd":643.3000001907349,"responseStart":501.90000009536743,"secureConnectionStart":407.30000019073486},{"duration":498,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":407.5,"connectEnd":407.5,"connectStart":407.5,"domainLookupEnd":407.5,"domainLookupStart":407.5,"fetchStart":407.5,"redirectEnd":0,"redirectStart":0,"requestStart":480.09999990463257,"responseEnd":905.5,"responseStart":500.09999990463257,"secureConnectionStart":407.5},{"duration":92.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":407.7000002861023,"connectEnd":407.7000002861023,"connectStart":407.7000002861023,"domainLookupEnd":407.7000002861023,"domainLookupStart":407.7000002861023,"fetchStart":407.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":480.30000019073486,"responseEnd":500,"responseStart":499,"secureConnectionStart":407.7000002861023},{"duration":99.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":407.80000019073486,"connectEnd":407.80000019073486,"connectStart":407.80000019073486,"domainLookupEnd":407.80000019073486,"domainLookupStart":407.80000019073486,"fetchStart":407.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":480.40000009536743,"responseEnd":507.40000009536743,"responseStart":504.7000002861023,"secureConnectionStart":407.80000019073486},{"duration":96.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":407.90000009536743,"connectEnd":407.90000009536743,"connectStart":407.90000009536743,"domainLookupEnd":407.90000009536743,"domainLookupStart":407.90000009536743,"fetchStart":407.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":480.40000009536743,"responseEnd":504.59999990463257,"responseStart":503.80000019073486,"secureConnectionStart":407.90000009536743},{"duration":67.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":408.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":408.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":475.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":95.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":408.30000019073486,"connectEnd":408.30000019073486,"connectStart":408.30000019073486,"domainLookupEnd":408.30000019073486,"domainLookupStart":408.30000019073486,"fetchStart":408.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":480.80000019073486,"responseEnd":503.7000002861023,"responseStart":502.80000019073486,"secureConnectionStart":408.30000019073486},{"duration":67.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":408.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":408.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":476,"responseStart":0,"secureConnectionStart":0},{"duration":107,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":408.59999990463257,"connectEnd":408.59999990463257,"connectStart":408.59999990463257,"domainLookupEnd":408.59999990463257,"domainLookupStart":408.59999990463257,"fetchStart":408.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":480.90000009536743,"responseEnd":515.5999999046326,"responseStart":514.3000001907349,"secureConnectionStart":408.59999990463257},{"duration":769.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":440.30000019073486,"connectEnd":440.30000019073486,"connectStart":440.30000019073486,"domainLookupEnd":440.30000019073486,"domainLookupStart":440.30000019073486,"fetchStart":440.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":1048.5999999046326,"responseEnd":1210.2000002861023,"responseStart":1188.5,"secureConnectionStart":440.30000019073486},{"duration":766.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":444,"connectEnd":444,"connectStart":444,"domainLookupEnd":444,"domainLookupStart":444,"fetchStart":444,"redirectEnd":0,"redirectStart":0,"requestStart":1113.3000001907349,"responseEnd":1210.5999999046326,"responseStart":1202.7000002861023,"secureConnectionStart":444},{"duration":350.3999996185303,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":802.2000002861023,"connectEnd":802.2000002861023,"connectStart":802.2000002861023,"domainLookupEnd":802.2000002861023,"domainLookupStart":802.2000002861023,"fetchStart":802.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1113.5999999046326,"responseEnd":1152.5999999046326,"responseStart":1150.8000001907349,"secureConnectionStart":802.2000002861023},{"duration":238,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1195.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1195.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1433.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":145.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1214.9000000953674,"connectEnd":1214.9000000953674,"connectStart":1214.9000000953674,"domainLookupEnd":1214.9000000953674,"domainLookupStart":1214.9000000953674,"fetchStart":1214.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1325.9000000953674,"responseEnd":1360.4000000953674,"responseStart":1359.3000001907349,"secureConnectionStart":1214.9000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":166,"responseStart":398,"responseEnd":442,"domLoading":405,"domInteractive":1485,"domContentLoadedEventStart":1485,"domContentLoadedEventEnd":1551,"domComplete":2021,"loadEventStart":2021,"loadEventEnd":2022,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1442},{"name":"bigPipe.sidebar-id.end","time":1442.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1443.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1444.5999999046326},{"name":"activityTabFullyLoaded","time":1567.0999999046326}],"measures":[],"correlationId":"149a1f89e3028e","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":101,"dbReadsTimeInMs":17,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
OK to push. But, the test must re-disable the foreign_key_checks for any future test that will be added to this file:
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test
index 0af5a9b97ba..9917677ca1a 100644
--- a/mysql-test/suite/innodb/t/insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/insert_into_empty.test
@@ -292,3 +292,17 @@ 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 #
+SET @auto_commit_val=@@autocommit;
+SET AUTOCOMMIT=0;
+CREATE TABLE t1 (c INT)ENGINE=InnoDB;
+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;
Would a simpler test case that uses the default autocommit=1 mode reproduce this? That is, replace the SET AUTOCOMMIT=0 with BEGIN and the CREATE TABLE t2 with COMMIT. I think that the bogus debug assertion should fail on COMMIT (which the CREATE TABLE t2 is implicitly invoking).