#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":737.5,"ttfb":198.69999992847443,"pageVisibility":"visible","entityId":70920,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"6d38e10f-2f04-41ae-9878-a8ffff31e5f9","navigationType":0,"readyForUser":814.6999999284744,"redirectCount":0,"resourceLoadedEnd":472.6999999284744,"resourceLoadedStart":209.60000002384186,"resourceTiming":[{"duration":15.899999976158142,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":209.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":209.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":225.5,"responseStart":0,"secureConnectionStart":0},{"duration":16.299999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":209.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":209.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":226.19999992847443,"responseStart":0,"secureConnectionStart":0},{"duration":108.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":210.10000002384186,"connectEnd":210.10000002384186,"connectStart":210.10000002384186,"domainLookupEnd":210.10000002384186,"domainLookupStart":210.10000002384186,"fetchStart":210.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":227.60000002384186,"responseEnd":318.5,"responseStart":244.39999997615814,"secureConnectionStart":210.10000002384186},{"duration":222,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":210.60000002384186,"connectEnd":210.60000002384186,"connectStart":210.60000002384186,"domainLookupEnd":210.60000002384186,"domainLookupStart":210.60000002384186,"fetchStart":210.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":229.79999995231628,"responseEnd":432.60000002384186,"responseStart":247.69999992847443,"secureConnectionStart":210.60000002384186},{"duration":40.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":210.69999992847443,"connectEnd":210.69999992847443,"connectStart":210.69999992847443,"domainLookupEnd":210.69999992847443,"domainLookupStart":210.69999992847443,"fetchStart":210.69999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":231.5,"responseEnd":251.19999992847443,"responseStart":248.19999992847443,"secureConnectionStart":210.69999992847443},{"duration":46.300000071525574,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":210.69999992847443,"connectEnd":210.69999992847443,"connectStart":210.69999992847443,"domainLookupEnd":210.69999992847443,"domainLookupStart":210.69999992847443,"fetchStart":210.69999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":236.5,"responseEnd":257,"responseStart":253.89999997615814,"secureConnectionStart":210.69999992847443},{"duration":45.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":210.79999995231628,"connectEnd":210.79999995231628,"connectStart":210.79999995231628,"domainLookupEnd":210.79999995231628,"domainLookupStart":210.79999995231628,"fetchStart":210.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":236.69999992847443,"responseEnd":256.6999999284744,"responseStart":253.5,"secureConnectionStart":210.79999995231628},{"duration":22.700000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":210.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":210.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":233.60000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":23.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":211.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":234.60000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":46.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":211.10000002384186,"connectEnd":211.10000002384186,"connectStart":211.10000002384186,"domainLookupEnd":211.10000002384186,"domainLookupStart":211.10000002384186,"fetchStart":211.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":238.29999995231628,"responseEnd":257.5,"responseStart":255,"secureConnectionStart":211.10000002384186},{"duration":46.700000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":211.29999995231628,"connectEnd":211.29999995231628,"connectStart":211.29999995231628,"domainLookupEnd":211.29999995231628,"domainLookupStart":211.29999995231628,"fetchStart":211.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":238.39999997615814,"responseEnd":258,"responseStart":255.79999995231628,"secureConnectionStart":211.29999995231628},{"duration":224.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":247.79999995231628,"connectEnd":247.79999995231628,"connectStart":247.79999995231628,"domainLookupEnd":247.79999995231628,"domainLookupStart":247.79999995231628,"fetchStart":247.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":351.6999999284744,"responseEnd":472.2999999523163,"responseStart":468.1999999284744,"secureConnectionStart":247.79999995231628},{"duration":213.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":259.60000002384186,"connectEnd":259.60000002384186,"connectStart":259.60000002384186,"domainLookupEnd":259.60000002384186,"domainLookupStart":259.60000002384186,"fetchStart":259.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":383,"responseEnd":472.6999999284744,"responseStart":469.6999999284744,"secureConnectionStart":259.60000002384186},{"duration":109.79999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":447.89999997615814,"connectEnd":447.89999997615814,"connectStart":447.89999997615814,"domainLookupEnd":447.89999997615814,"domainLookupStart":447.89999997615814,"fetchStart":447.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":523.3999999761581,"responseEnd":557.6999999284744,"responseStart":557,"secureConnectionStart":447.89999997615814},{"duration":268.6999999284744,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":662.1000000238419,"connectEnd":662.1000000238419,"connectStart":662.1000000238419,"domainLookupEnd":662.1000000238419,"domainLookupStart":662.1000000238419,"fetchStart":662.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":898.1000000238419,"responseEnd":930.7999999523163,"responseStart":930.1999999284744,"secureConnectionStart":662.1000000238419}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":47,"responseStart":199,"responseEnd":260,"domLoading":202,"domInteractive":873,"domContentLoadedEventStart":873,"domContentLoadedEventEnd":921,"domComplete":1642,"loadEventStart":1642,"loadEventEnd":1643,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":850.1999999284744},{"name":"bigPipe.sidebar-id.end","time":850.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.start","time":851.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":853.1000000238419},{"name":"activityTabFullyLoaded","time":934.6999999284744}],"measures":[],"correlationId":"7c5ff577f242a9","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":91,"dbReadsTimeInMs":13,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
note to self: the commit c2b3a4c253a76c1aaa6ef5d96bb7995afc3a572b maikes rocksdb.kill to fail