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":953.3999998569489,"ttfb":283.2999999523163,"pageVisibility":"visible","entityId":91542,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"14955c85-daed-4922-94ed-13f8bcad52c1","navigationType":0,"readyForUser":1035.5,"redirectCount":0,"resourceLoadedEnd":1467.0999999046326,"resourceLoadedStart":288.2999999523163,"resourceTiming":[{"duration":155.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":288.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":288.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":444.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":156,"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":288.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":288.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":444.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":210.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":288.7999999523163,"connectEnd":288.7999999523163,"connectStart":288.7999999523163,"domainLookupEnd":288.7999999523163,"domainLookupStart":288.7999999523163,"fetchStart":288.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":288.7999999523163,"responseEnd":499.09999990463257,"responseStart":499.09999990463257,"secureConnectionStart":288.7999999523163},{"duration":294,"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":289,"connectEnd":289,"connectStart":289,"domainLookupEnd":289,"domainLookupStart":289,"fetchStart":289,"redirectEnd":0,"redirectStart":0,"requestStart":289,"responseEnd":583,"responseStart":583,"secureConnectionStart":289},{"duration":297.5,"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":289.09999990463257,"connectEnd":289.09999990463257,"connectStart":289.09999990463257,"domainLookupEnd":289.09999990463257,"domainLookupStart":289.09999990463257,"fetchStart":289.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":289.09999990463257,"responseEnd":586.5999999046326,"responseStart":586.5999999046326,"secureConnectionStart":289.09999990463257},{"duration":297.60000014305115,"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":289.39999985694885,"connectEnd":289.39999985694885,"connectStart":289.39999985694885,"domainLookupEnd":289.39999985694885,"domainLookupStart":289.39999985694885,"fetchStart":289.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":289.39999985694885,"responseEnd":587,"responseStart":587,"secureConnectionStart":289.39999985694885},{"duration":297.89999985694885,"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":289.5,"connectEnd":289.5,"connectStart":289.5,"domainLookupEnd":289.5,"domainLookupStart":289.5,"fetchStart":289.5,"redirectEnd":0,"redirectStart":0,"requestStart":289.5,"responseEnd":587.3999998569489,"responseStart":587.3999998569489,"secureConnectionStart":289.5},{"duration":352.89999985694885,"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":289.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":289.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":642.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":298,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":289.7999999523163,"connectEnd":289.7999999523163,"connectStart":289.7999999523163,"domainLookupEnd":289.7999999523163,"domainLookupStart":289.7999999523163,"fetchStart":289.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":289.7999999523163,"responseEnd":587.7999999523163,"responseStart":587.7999999523163,"secureConnectionStart":289.7999999523163},{"duration":352.7000000476837,"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":289.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":289.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":642.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":298.2999999523163,"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":290.09999990463257,"connectEnd":290.09999990463257,"connectStart":290.09999990463257,"domainLookupEnd":290.09999990463257,"domainLookupStart":290.09999990463257,"fetchStart":290.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":290.09999990463257,"responseEnd":588.3999998569489,"responseStart":588.3999998569489,"secureConnectionStart":290.09999990463257},{"duration":1012.1000001430511,"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":295.89999985694885,"connectEnd":295.89999985694885,"connectStart":295.89999985694885,"domainLookupEnd":295.89999985694885,"domainLookupStart":295.89999985694885,"fetchStart":295.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":295.89999985694885,"responseEnd":1308,"responseStart":1308,"secureConnectionStart":295.89999985694885},{"duration":1166.0999999046326,"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":301,"connectEnd":301,"connectStart":301,"domainLookupEnd":301,"domainLookupStart":301,"fetchStart":301,"redirectEnd":0,"redirectStart":0,"requestStart":301,"responseEnd":1467.0999999046326,"responseStart":1467.0999999046326,"secureConnectionStart":301},{"duration":654.7000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":653.7999999523163,"connectEnd":653.7999999523163,"connectStart":653.7999999523163,"domainLookupEnd":653.7999999523163,"domainLookupStart":653.7999999523163,"fetchStart":653.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":653.7999999523163,"responseEnd":1308.5,"responseStart":1308.5,"secureConnectionStart":653.7999999523163},{"duration":524.2999999523163,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":947.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":947.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1471.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":113,"responseStart":283,"responseEnd":301,"domLoading":286,"domInteractive":1504,"domContentLoadedEventStart":1504,"domContentLoadedEventEnd":1555,"domComplete":1842,"loadEventStart":1842,"loadEventEnd":1842,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1472.3999998569489},{"name":"bigPipe.sidebar-id.end","time":1473.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.start","time":1473.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1477.2000000476837},{"name":"activityTabFullyLoaded","time":1572.0999999046326}],"measures":[],"correlationId":"182a08ecf8a63","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":102,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Roel, I believe the ALTER TABLE t DISCARD TABLESPACE is broken by design, basically corrupting the table by removing the data file while retaining the metadata.
TRUNCATE TABLE will fix this corruption by creating an empty table. It will also issue a warning if the tablespace had been discarded.
If you see assertions mysql_socket.fd != 1 failing, those should have nothing to do with InnoDB. In any case, that should be a separate bug.