#7 0x00007ff8cad17f12 in __GI___assert_fail (assertion=0x55779cd65850 "thd->transaction.stmt.is_empty()", file=0x55779cd64fd0 "/data/src/10.4/sql/sql_base.cc", line=2455, function=0x55779cd67280 <Locked_tables_list::unlock_locked_tables(THD*)::__PRETTY_FUNCTION__> "void Locked_tables_list::unlock_locked_tables(THD*)") at assert.c:101
#8 0x000055779bfdb370 in Locked_tables_list::unlock_locked_tables (this=0x7ff870004860, thd=0x7ff870000af0) at /data/src/10.4/sql/sql_base.cc:2455
#9 0x000055779bfdb7b3 in Locked_tables_list::unlink_all_closed_tables (this=0x7ff870004860, thd=0x7ff870000af0, lock=0x0, reopen_count=0) at /data/src/10.4/sql/sql_base.cc:2634
#10 0x000055779bfdba52 in Locked_tables_list::reopen_tables (this=0x7ff870004860, thd=0x7ff870000af0, need_reopen=false) at /data/src/10.4/sql/sql_base.cc:2688
#11 0x000055779c172e9e in mysql_alter_table (thd=0x7ff870000af0, new_db=0x7ff8700052b0, new_name=0x7ff8700056b8, create_info=0x7ff8c409bcf0, table_list=0x7ff870011ec0, alter_info=0x7ff8c409bc30, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10397
#12 0x000055779c20a341 in Sql_cmd_alter_table::execute (this=0x7ff8700126a8, thd=0x7ff870000af0) at /data/src/10.4/sql/sql_alter.cc:508
#13 0x000055779c088d95 in mysql_execute_command (thd=0x7ff870000af0) at /data/src/10.4/sql/sql_parse.cc:6102
#14 0x000055779c08e457 in mysql_parse (thd=0x7ff870000af0, rawbuf=0x7ff870011dd8 "ALTER TABLE t1 ADD COLUMN b INT", length=31, parser_state=0x7ff8c409d160, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7901
#15 0x000055779c0795fc in dispatch_command (command=COM_QUERY, thd=0x7ff870000af0, packet=0x7ff8700083a1 "ALTER TABLE t1 ADD COLUMN b INT", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
#16 0x000055779c077c89 in do_command (thd=0x7ff870000af0) at /data/src/10.4/sql/sql_parse.cc:1360
#17 0x000055779c200c51 in do_handle_one_connection (connect=0x5577a04668e0) at /data/src/10.4/sql/sql_connect.cc:1412
#18 0x000055779c2009a0 in handle_one_connection (arg=0x5577a04668e0) at /data/src/10.4/sql/sql_connect.cc:1316
#19 0x000055779cc06b0d in pfs_spawn_thread (arg=0x5577a03d3360) at /data/src/10.4/storage/perfschema/pfs.cc:1862
#20 0x00007ff8ccca04a4 in start_thread (arg=0x7ff8c409e700) at pthread_create.c:456
#21 0x00007ff8cadd4d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
Reproducible with 10.1-10.5.
The test case fails for me every time, but it still involves a race condition, so try to run with --repeat=N if it doesn't fail right away.
No obvious problem on a non-debug build.
Attachments
Issue Links
is caused by
MDEV-5587Server crashes in Locked_tables_list::restore_lock on CREATE OR REPLACE .. SELECT under LOCK
The same bug also affects LOCK TABLES ; CREATE TRIGGER:
CREATE TABLE t1 (id int(11)) ENGINE=InnoDB;
LOCK TABLES t1 WRITE;
SET max_statement_time= 0.0001;
--error 0,1969
--disable_warnings
CREATE TRIGGER tr16 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t1 VALUES (1);
--enable_warnings
SET max_statement_time= default;
DROP TRIGGER IF EXISTS trg16;
DROP TABLE t1;
Michael Widenius
added a comment - The same bug also affects LOCK TABLES ; CREATE TRIGGER:
CREATE TABLE t1 (id int(11)) ENGINE=InnoDB;
LOCK TABLES t1 WRITE;
SET max_statement_time= 0.0001;
--error 0,1969
--disable_warnings
CREATE TRIGGER tr16 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t1 VALUES (1);
--enable_warnings
SET max_statement_time= default;
DROP TRIGGER IF EXISTS trg16;
DROP TABLE t1;
The problem was that when LOCK TABLES where unwinded as part of
a killed connection, unlink_all_closed_tables() did not like that
there was uncommitted transactions.
Fixed by doing a rollback of any open transaction in this particular case.
Michael Widenius
added a comment - Fixed
The problem was that when LOCK TABLES where unwinded as part of
a killed connection, unlink_all_closed_tables() did not like that
there was uncommitted transactions.
Fixed by doing a rollback of any open transaction in this particular case.
People
Michael Widenius
Alice Sherepa
Votes:
0Vote for this issue
Watchers:
7Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":2051.800000190735,"ttfb":424.5,"pageVisibility":"visible","entityId":70920,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"1e1ddb34-a38b-4912-be1d-efe65de01717","navigationType":0,"readyForUser":2168.5,"redirectCount":0,"resourceLoadedEnd":2384.9000000953674,"resourceLoadedStart":439.90000009536743,"resourceTiming":[{"duration":935.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":439.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":439.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1375.1000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":935.2999999523163,"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":440.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":440.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1375.5,"responseStart":0,"secureConnectionStart":0},{"duration":978,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":440.40000009536743,"connectEnd":440.40000009536743,"connectStart":440.40000009536743,"domainLookupEnd":440.40000009536743,"domainLookupStart":440.40000009536743,"fetchStart":440.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":440.40000009536743,"responseEnd":1418.4000000953674,"responseStart":1418.4000000953674,"secureConnectionStart":440.40000009536743},{"duration":1162.0999999046326,"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":440.60000014305115,"connectEnd":440.60000014305115,"connectStart":440.60000014305115,"domainLookupEnd":440.60000014305115,"domainLookupStart":440.60000014305115,"fetchStart":440.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":440.60000014305115,"responseEnd":1602.7000000476837,"responseStart":1602.7000000476837,"secureConnectionStart":440.60000014305115},{"duration":1166.3999998569489,"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":440.80000019073486,"connectEnd":440.80000019073486,"connectStart":440.80000019073486,"domainLookupEnd":440.80000019073486,"domainLookupStart":440.80000019073486,"fetchStart":440.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":440.80000019073486,"responseEnd":1607.2000000476837,"responseStart":1607.2000000476837,"secureConnectionStart":440.80000019073486},{"duration":1166.7000000476837,"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":441,"connectEnd":441,"connectStart":441,"domainLookupEnd":441,"domainLookupStart":441,"fetchStart":441,"redirectEnd":0,"redirectStart":0,"requestStart":441,"responseEnd":1607.7000000476837,"responseStart":1607.7000000476837,"secureConnectionStart":441},{"duration":1166.7999999523163,"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":441.2000000476837,"connectEnd":441.2000000476837,"connectStart":441.2000000476837,"domainLookupEnd":441.2000000476837,"domainLookupStart":441.2000000476837,"fetchStart":441.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":441.2000000476837,"responseEnd":1608,"responseStart":1608,"secureConnectionStart":441.2000000476837},{"duration":1167.4000000953674,"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":441.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":441.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1608.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":1167,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":441.60000014305115,"connectEnd":441.60000014305115,"connectStart":441.60000014305115,"domainLookupEnd":441.60000014305115,"domainLookupStart":441.60000014305115,"fetchStart":441.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":441.60000014305115,"responseEnd":1608.6000001430511,"responseStart":1608.5,"secureConnectionStart":441.60000014305115},{"duration":1167.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":441.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":441.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1609.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":1167.2000000476837,"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":441.90000009536743,"connectEnd":441.90000009536743,"connectStart":441.90000009536743,"domainLookupEnd":441.90000009536743,"domainLookupStart":441.90000009536743,"fetchStart":441.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":441.90000009536743,"responseEnd":1609.1000001430511,"responseStart":1609.1000001430511,"secureConnectionStart":441.90000009536743},{"duration":1364.8999998569489,"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":442.80000019073486,"connectEnd":442.80000019073486,"connectStart":442.80000019073486,"domainLookupEnd":442.80000019073486,"domainLookupStart":442.80000019073486,"fetchStart":442.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":442.80000019073486,"responseEnd":1807.7000000476837,"responseStart":1807.7000000476837,"secureConnectionStart":442.80000019073486},{"duration":1930.7000000476837,"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":442.90000009536743,"connectEnd":442.90000009536743,"connectStart":442.90000009536743,"domainLookupEnd":442.90000009536743,"domainLookupStart":442.90000009536743,"fetchStart":442.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":442.90000009536743,"responseEnd":2373.600000143051,"responseStart":2373.600000143051,"secureConnectionStart":442.90000009536743},{"duration":217.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1589.4000000953674,"connectEnd":1589.4000000953674,"connectStart":1589.4000000953674,"domainLookupEnd":1589.4000000953674,"domainLookupStart":1589.4000000953674,"fetchStart":1589.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1589.4000000953674,"responseEnd":1807.1000001430511,"responseStart":1807.1000001430511,"secureConnectionStart":1589.4000000953674},{"duration":447,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1937.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1937.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2384.9000000953674,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":260,"responseStart":424,"responseEnd":429,"domLoading":437,"domInteractive":2422,"domContentLoadedEventStart":2422,"domContentLoadedEventEnd":2478,"domComplete":3399,"loadEventStart":3399,"loadEventEnd":3400,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2388},{"name":"bigPipe.sidebar-id.end","time":2388.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":2389},{"name":"bigPipe.activity-panel-pipe-id.end","time":2391},{"name":"activityTabFullyLoaded","time":2495.7000000476837}],"measures":[],"correlationId":"c30558f694908b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":14,"dbConnsTimeInMs":24,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
note to self: the commit c2b3a4c253a76c1aaa6ef5d96bb7995afc3a572b maikes rocksdb.kill to fail