CREATE TABLE t(c INT) ENGINE=InnoDB;
|
ALTER TABLE t DISCARD TABLESPACE;
|
RENAME TABLE t TO u;
|
TRUNCATE u;
|
TRUNCATE u;
|
Leads to:
10.5.6 c5517cd86440b6669509211b1ad10f837a929952 (Debug)
|
mysqld: /test/10.5_dbg/storage/innobase/row/row0mysql.cc:3694: dberr_t row_drop_table_for_mysql(const char*, trx_t*, enum_sql_command, bool, bool): Assertion `table->data_dir_path || !space' failed.
|
10.5.6 c5517cd86440b6669509211b1ad10f837a929952 (Debug)
|
Core was generated by `/test/MD080920-mariadb-10.5.6-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
|
at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
|
[Current thread is 1 (Thread 0x14a736165700 (LWP 3580839))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
|
#1 0x000055e79331f4e8 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
|
#2 0x000055e792ae656b in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
|
#3 <signal handler called>
|
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
|
#5 0x000014a7343fb8b1 in __GI_abort () at abort.c:79
|
#6 0x000014a7343eb42a in __assert_fail_base (fmt=0x14a734572a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55e793773338 "table->data_dir_path || !space", file=file@entry=0x55e793770ee0 "/test/10.5_dbg/storage/innobase/row/row0mysql.cc", line=line@entry=3694, function=function@entry=0x55e793774220 <row_drop_table_for_mysql(char const*, trx_t*, enum_sql_command, bool, bool)::__PRETTY_FUNCTION__> "dberr_t row_drop_table_for_mysql(const char*, trx_t*, enum_sql_command, bool, bool)") at assert.c:92
|
#7 0x000014a7343eb4a2 in __GI___assert_fail (assertion=assertion@entry=0x55e793773338 "table->data_dir_path || !space", file=file@entry=0x55e793770ee0 "/test/10.5_dbg/storage/innobase/row/row0mysql.cc", line=line@entry=3694, function=function@entry=0x55e793774220 <row_drop_table_for_mysql(char const*, trx_t*, enum_sql_command, bool, bool)::__PRETTY_FUNCTION__> "dberr_t row_drop_table_for_mysql(const char*, trx_t*, enum_sql_command, bool, bool)") at assert.c:101
|
#8 0x000055e793029375 in row_drop_table_for_mysql (name=<optimized out>, name@entry=0x14a736162de0 "test/#sql-ib22", trx=trx@entry=0x14a721003548, sqlcom=sqlcom@entry=SQLCOM_TRUNCATE, create_failed=create_failed@entry=false, nonatomic=<optimized out>, nonatomic@entry=true) at /test/10.5_dbg/storage/innobase/row/row0mysql.cc:3694
|
#9 0x000055e792eccf7a in ha_innobase::delete_table (this=this@entry=0x14a7135246a0, name=<optimized out>, name@entry=0x14a7134570a0 "test/#sql-ib22", sqlcom=sqlcom@entry=SQLCOM_TRUNCATE) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:13210
|
#10 0x000055e792ec417d in ha_innobase::truncate (this=0x14a7135246a0) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:13603
|
#11 0x000055e792af4ddf in handler::ha_truncate (this=0x14a7135246a0) at /test/10.5_dbg/sql/handler.cc:4693
|
#12 0x000055e7929bdbda in Sql_cmd_truncate_table::handler_truncate (this=this@entry=0x14a713474830, thd=thd@entry=0x14a713415088, table_ref=table_ref@entry=0x14a713474158, is_tmp_table=is_tmp_table@entry=false) at /test/10.5_dbg/sql/sql_truncate.cc:238
|
#13 0x000055e7929be806 in Sql_cmd_truncate_table::truncate_table (this=this@entry=0x14a713474830, thd=thd@entry=0x14a713415088, table_ref=table_ref@entry=0x14a713474158) at /test/10.5_dbg/sql/sql_truncate.cc:461
|
#14 0x000055e7929be958 in Sql_cmd_truncate_table::execute (this=0x14a713474830, thd=0x14a713415088) at /test/10.5_dbg/sql/sql_truncate.cc:517
|
#15 0x000055e792838b44 in mysql_execute_command (thd=thd@entry=0x14a713415088) at /test/10.5_dbg/sql/sql_parse.cc:5952
|
#16 0x000055e7928404b8 in mysql_parse (thd=thd@entry=0x14a713415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a736164350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7994
|
#17 0x000055e79282cee8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a713415088, packet=packet@entry=0x14a713467089 "TRUNCATE u", packet_length=packet_length@entry=10, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1867
|
#18 0x000055e79282b6d2 in do_command (thd=0x14a713415088) at /test/10.5_dbg/sql/sql_parse.cc:1348
|
#19 0x000055e79298aa27 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14a7150d42c8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
|
#20 0x000055e79298b14b in handle_one_connection (arg=arg@entry=0x14a7150d42c8) at /test/10.5_dbg/sql/sql_connect.cc:1312
|
#21 0x000055e792df5784 in pfs_spawn_thread (arg=0x14a733046508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
|
#22 0x000014a7350de6db in start_thread (arg=0x14a736165700) at pthread_create.c:463
|
#23 0x000014a7344dca3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.2.34 (dbg), 10.3.25 (dbg), 10.4.15 (dbg), 10.5.6 (dbg)
Bug confirmed not present in:
MariaDB: 10.1.47 (dbg), 10.1.47 (opt), 10.2.34 (opt), 10.3.25 (opt), 10.4.15 (opt), 10.5.6 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)
{"report":{"fcp":800.3000001907349,"ttfb":177.80000019073486,"pageVisibility":"visible","entityId":91542,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"4ab3214e-f8ab-42b7-ad71-0b4459b84bb6","navigationType":0,"readyForUser":890.6999998092651,"redirectCount":0,"resourceLoadedEnd":752.5,"resourceLoadedStart":186.40000009536743,"resourceTiming":[{"duration":5.900000095367432,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":186.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":186.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":192.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":5.799999713897705,"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":186.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":186.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":192.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":70.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":187,"connectEnd":187,"connectStart":187,"domainLookupEnd":187,"domainLookupStart":187,"fetchStart":187,"redirectEnd":0,"redirectStart":0,"requestStart":187,"responseEnd":257.80000019073486,"responseStart":257.80000019073486,"secureConnectionStart":187},{"duration":142.59999990463257,"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":187.59999990463257,"connectEnd":187.59999990463257,"connectStart":187.59999990463257,"domainLookupEnd":187.59999990463257,"domainLookupStart":187.59999990463257,"fetchStart":187.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":187.59999990463257,"responseEnd":330.19999980926514,"responseStart":330.19999980926514,"secureConnectionStart":187.59999990463257},{"duration":146.19999980926514,"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":187.90000009536743,"connectEnd":187.90000009536743,"connectStart":187.90000009536743,"domainLookupEnd":187.90000009536743,"domainLookupStart":187.90000009536743,"fetchStart":187.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":187.90000009536743,"responseEnd":334.09999990463257,"responseStart":334.09999990463257,"secureConnectionStart":187.90000009536743},{"duration":146.5,"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":188.09999990463257,"connectEnd":188.09999990463257,"connectStart":188.09999990463257,"domainLookupEnd":188.09999990463257,"domainLookupStart":188.09999990463257,"fetchStart":188.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":188.09999990463257,"responseEnd":334.59999990463257,"responseStart":334.59999990463257,"secureConnectionStart":188.09999990463257},{"duration":146.7000002861023,"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":188.19999980926514,"connectEnd":188.19999980926514,"connectStart":188.19999980926514,"domainLookupEnd":188.19999980926514,"domainLookupStart":188.19999980926514,"fetchStart":188.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":188.19999980926514,"responseEnd":334.90000009536743,"responseStart":334.90000009536743,"secureConnectionStart":188.19999980926514},{"duration":215,"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":188.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":188.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":403.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":146.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":188.59999990463257,"connectEnd":188.59999990463257,"connectStart":188.59999990463257,"domainLookupEnd":188.59999990463257,"domainLookupStart":188.59999990463257,"fetchStart":188.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":188.59999990463257,"responseEnd":335.40000009536743,"responseStart":335.40000009536743,"secureConnectionStart":188.59999990463257},{"duration":214.69999980926514,"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":188.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":188.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":403.5,"responseStart":0,"secureConnectionStart":0},{"duration":147,"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":189,"connectEnd":189,"connectStart":189,"domainLookupEnd":189,"domainLookupStart":189,"fetchStart":189,"redirectEnd":0,"redirectStart":0,"requestStart":189,"responseEnd":336,"responseStart":336,"secureConnectionStart":189},{"duration":367.7000002861023,"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":195.59999990463257,"connectEnd":195.59999990463257,"connectStart":195.59999990463257,"domainLookupEnd":195.59999990463257,"domainLookupStart":195.59999990463257,"fetchStart":195.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":195.59999990463257,"responseEnd":563.3000001907349,"responseStart":563.3000001907349,"secureConnectionStart":195.59999990463257},{"duration":500.09999990463257,"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":205.59999990463257,"connectEnd":205.59999990463257,"connectStart":205.59999990463257,"domainLookupEnd":205.59999990463257,"domainLookupStart":205.59999990463257,"fetchStart":205.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":205.59999990463257,"responseEnd":705.6999998092651,"responseStart":705.6999998092651,"secureConnectionStart":205.59999990463257},{"duration":192.2999997138977,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":415.30000019073486,"connectEnd":415.30000019073486,"connectStart":415.30000019073486,"domainLookupEnd":415.30000019073486,"domainLookupStart":415.30000019073486,"fetchStart":415.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":415.30000019073486,"responseEnd":607.5999999046326,"responseStart":607.5999999046326,"secureConnectionStart":415.30000019073486},{"duration":58.09999990463257,"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":694.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":694.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":752.5,"responseStart":0,"secureConnectionStart":0},{"duration":350.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":695.3000001907349,"connectEnd":695.3000001907349,"connectStart":695.3000001907349,"domainLookupEnd":695.3000001907349,"domainLookupStart":695.3000001907349,"fetchStart":695.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":695.3000001907349,"responseEnd":1045.6999998092651,"responseStart":1045.6999998092651,"secureConnectionStart":695.3000001907349},{"duration":354.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/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.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":695.6999998092651,"connectEnd":695.6999998092651,"connectStart":695.6999998092651,"domainLookupEnd":695.6999998092651,"domainLookupStart":695.6999998092651,"fetchStart":695.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":695.6999998092651,"responseEnd":1050.0999999046326,"responseStart":1050.0999999046326,"secureConnectionStart":695.6999998092651}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":9,"responseStart":178,"responseEnd":205,"domLoading":181,"domInteractive":970,"domContentLoadedEventStart":970,"domContentLoadedEventEnd":1037,"domComplete":1286,"loadEventStart":1286,"loadEventEnd":1286,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":934.0999999046326},{"name":"bigPipe.sidebar-id.end","time":935},{"name":"bigPipe.activity-panel-pipe-id.start","time":935.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":939.1999998092651},{"name":"activityTabFullyLoaded","time":1055.1999998092651}],"measures":[],"correlationId":"7c049cd8d18d38","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
This is a rather interesting bug. The DATA DIRECTORY flag will be wrongly set. And not only that, the table->data_dir_path will have been truncated to "./t":
10.2 e05650e6868eab2dbb9f58c4786bcc71afc4ffce
Thread 3 hit Watchpoint 8: table->data_dir_path[3]
Old value = 101 'e'
New value = 0 '\000'
os_file_make_data_dir_path (data_dir_path=<optimized out>) at /mariadb/10.2o/storage/innobase/os/os0file.cc:1393
1393 }
(rr) bt
#0 os_file_make_data_dir_path (data_dir_path=<optimized out>) at /mariadb/10.2o/storage/innobase/os/os0file.cc:1393
#1 0x000055685158363d in dict_save_data_dir_path (table=0x7f635816c6b0, filepath=<optimized out>) at /mariadb/10.2o/storage/innobase/dict/dict0load.cc:2724
#2 dict_get_and_save_data_dir_path (table=0x7f635816c6b0, dict_mutex_own=false) at /mariadb/10.2o/storage/innobase/dict/dict0load.cc:2755
#3 0x00005568512eeaa2 in ha_innobase::truncate (this=0x7f6358091f60) at /mariadb/10.2o/storage/innobase/handler/ha_innodb.cc:13706
I was suspecting heap-use-after-free, but WITH_ASAN will not flag anything before the assertion failure. We seem to get this truncated data_file_name = "./t" on the first invocation of ha_innobase::truncate().