Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
10.6.3 , 10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION' ;
SET DEFAULT_STORAGE_ENGINE= 'InnoDB' ;
USE test ;
CREATE TABLE `t1` (
`col_varchar_255` varchar(255),
`col_int` int,
`col_text` text) ENGINE=innodb ;
FLUSH TABLES t1 FOR EXPORT ;
UNLOCK TABLES ;
CREATE TABLE imp_t1 LIKE t1 ;
ALTER TABLE imp_t1 ADD KEY idx ( col_text(13) ) ;
'copy ibd file around'
ALTER TABLE imp_t1 DISCARD TABLESPACE ;
ALTER TABLE imp_t1 IMPORT TABLESPACE ;
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
'copy ibd file around'
ALTER TABLE imp_t1 IMPORT TABLESPACE ;
ERROR HY000: Lost connection to server during query
DROP TABLE t1, imp_t1 ;
main.ML_import1 'innodb' [ fail ]
Test ended at 2021-07-12 09:31:01
CURRENT_TEST: main.ML_import1
/data/Server_bin/10.6G_fast/bin/mysqltest: Can't create/write to file '/data/Server_bin/10.6G_fast/mysql-test/var/mysqld.1/data/test/imp_t1.ibd' (Errcode: 17 "File exists")
mysqltest: At line 35: query 'DROP TABLE t1, imp_t1 ' failed: <Unknown> (2006): Server has gone away
...
2021-07-12 9:31:00 0 [Note] /data/Server_bin/10.6G_fast/bin/mariadbd: ready for connections.
Version: '10.6.3-MariaDB-log' socket: '/data/Server_bin/10.6G_fast/mysql-test/var/tmp/mysqld.1.sock' port: 16000 Source distribution
2021-07-12 9:31:00 4 [Note] InnoDB: Sync to disk of `test`.`t1` started.
2021-07-12 9:31:00 4 [Note] InnoDB: Stopping purge
2021-07-12 9:31:00 4 [Note] InnoDB: Writing table metadata to './test/t1.cfg'
2021-07-12 9:31:00 4 [Note] InnoDB: Table `test`.`t1` flushed to disk
2021-07-12 9:31:00 4 [Note] InnoDB: Deleting the meta-data file './test/t1.cfg'
2021-07-12 9:31:00 4 [Note] InnoDB: Resuming purge
2021-07-12 9:31:00 4 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2021-07-12 9:31:00 4 [ERROR] InnoDB: The error means the system cannot find the path specified.
2021-07-12 9:31:00 4 [ERROR] InnoDB: Trying to import a tablespace, but could not open the tablespace file ./test/imp_t1.ibd
2021-07-12 9:31:00 4 [Note] InnoDB: Discarding tablespace of table `test`.`imp_t1`: Tablespace not found
2021-07-12 9:31:00 4 [Note] InnoDB: Sync to disk
2021-07-12 9:31:00 4 [Note] InnoDB: Sync to disk - done!
2021-07-12 9:31:00 4 [Warning] InnoDB: Table `test`.`imp_t1` should have 2 indexes but the tablespace has 1 indexes
2021-07-12 9:31:00 4 [Note] InnoDB: Phase I - Update all pages
2021-07-12 9:31:00 4 [Note] InnoDB: Sync to disk
2021-07-12 9:31:00 4 [Note] InnoDB: Sync to disk - done!
2021-07-12 9:31:00 4 [Warning] InnoDB: Skip adjustment of root pages for index `idx`.
2021-07-12 9:31:00 4 [Note] InnoDB: Phase III - Flush changes to disk
2021-07-12 9:31:00 4 [Note] InnoDB: Phase IV - Flush complete
2021-07-12 9:31:00 4 [ERROR] InnoDB: Index `idx` of table `test`.`imp_t1` is corrupted
2021-07-12 9:31:00 4 [Note] InnoDB: Load corrupted index `idx` of table `test`.`imp_t1`
2021-07-12 9:31:00 4 [ERROR] InnoDB: Trying to load index `idx` for table `test`.`imp_t1`, but the index tree has been freed!
2021-07-12 9:31:00 4 [Warning] InnoDB: Failed to load table `test`.`imp_t1`:Data structure corruption
210712 9:31:00 [ERROR] mysqld got signal 11 ;
...
Query (0x7f3bbc010650): ALTER TABLE imp_t1 IMPORT TABLESPACE
Connection ID (thread ID): 4
Status: NOT_KILLED
#3 <signal handler called>
#4 0x000055c41ab763e0 in ha_innobase::discard_or_import_tablespace (this=0x7f3bbc0baa70, discard=<optimized out>) at /data/Server/10.6G/storage/innobase/handler/ha_innodb.cc:13201
#5 0x000055c41a77ff96 in mysql_discard_or_import_tablespace (thd=thd@entry=0x7f3bbc000c58, table_list=table_list@entry=0x7f3bbc010740, discard=<optimized out>) at /data/Server/10.6G/sql/sql_table.cc:5463
#6 0x000055c41a7ebe54 in Sql_cmd_discard_import_tablespace::execute (this=0x7f3bbc010e28, thd=0x7f3bbc000c58) at /data/Server/10.6G/sql/sql_alter.cc:591
#7 0x000055c41a6ed626 in mysql_execute_command (thd=0x7f3bbc000c58, is_called_from_prepared_stmt=<optimized out>) at /data/Server/10.6G/sql/sql_parse.cc:5995
#8 0x000055c41a6de446 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x7f3bbc000c58) at /data/Server/10.6G/sql/sql_parse.cc:8028
#9 mysql_parse (thd=0x7f3bbc000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /data/Server/10.6G/sql/sql_parse.cc:7950
#10 0x000055c41a6e9e12 in dispatch_command (command=COM_QUERY, thd=0x7f3bbc000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /data/Server/10.6G/sql/sql_class.h:1340
#11 0x000055c41a6eba98 in do_command (thd=0x7f3bbc000c58, blocking=blocking@entry=true) at /data/Server/10.6G/sql/sql_parse.cc:1406
#12 0x000055c41a7e7837 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c41e0a5a58, put_in_cache=put_in_cache@entry=true) at /data/Server/10.6G/sql/sql_connect.cc:1410
#13 0x000055c41a7e7b2d in handle_one_connection (arg=0x55c41e0a5a58) at /data/Server/10.6G/sql/sql_connect.cc:1312
#14 0x00007f3bf84df609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x00007f3bf80b3293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
GIT_SHOW: HEAD, origin/HEAD, origin/10.6, 10.6 315380a4d16ddb16461d906a23be341e354c30ed 2021-07-01T19:06:53+03:00
I am aware that the MTR test shows some rather ugly scenario. But mistakes happen and they should not end up with SEGV.
{"report":{"fcp":1186.6000000014901,"ttfb":596.9000000022352,"pageVisibility":"visible","entityId":101179,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":16,"apdex":0.5,"journeyId":"7e6f1999-0a9a-4eb8-b04e-d35dc9cad12d","navigationType":0,"readyForUser":1324.4000000022352,"redirectCount":0,"resourceLoadedEnd":1434.6000000014901,"resourceLoadedStart":602.7000000029802,"resourceTiming":[{"duration":14.799999997019768,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":602.7000000029802,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":602.7000000029802,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":617.5,"responseStart":0,"secureConnectionStart":0},{"duration":14.600000001490116,"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":603,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":603,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":617.6000000014901,"responseStart":0,"secureConnectionStart":0},{"duration":98.19999999925494,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":603.1000000014901,"connectEnd":603.1000000014901,"connectStart":603.1000000014901,"domainLookupEnd":603.1000000014901,"domainLookupStart":603.1000000014901,"fetchStart":603.1000000014901,"redirectEnd":0,"redirectStart":0,"requestStart":603.1000000014901,"responseEnd":701.3000000007451,"responseStart":701.3000000007451,"secureConnectionStart":603.1000000014901},{"duration":255.09999999776483,"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":603.2000000029802,"connectEnd":603.2000000029802,"connectStart":603.2000000029802,"domainLookupEnd":603.2000000029802,"domainLookupStart":603.2000000029802,"fetchStart":603.2000000029802,"redirectEnd":0,"redirectStart":0,"requestStart":603.2000000029802,"responseEnd":858.3000000007451,"responseStart":858.3000000007451,"secureConnectionStart":603.2000000029802},{"duration":260.69999999925494,"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":603.3000000007451,"connectEnd":603.3000000007451,"connectStart":603.3000000007451,"domainLookupEnd":603.3000000007451,"domainLookupStart":603.3000000007451,"fetchStart":603.3000000007451,"redirectEnd":0,"redirectStart":0,"requestStart":603.3000000007451,"responseEnd":864,"responseStart":864,"secureConnectionStart":603.3000000007451},{"duration":261.5,"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":603.4000000022352,"connectEnd":603.4000000022352,"connectStart":603.4000000022352,"domainLookupEnd":603.4000000022352,"domainLookupStart":603.4000000022352,"fetchStart":603.4000000022352,"redirectEnd":0,"redirectStart":0,"requestStart":603.4000000022352,"responseEnd":864.9000000022352,"responseStart":864.9000000022352,"secureConnectionStart":603.4000000022352},{"duration":261.8999999985099,"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":603.4000000022352,"connectEnd":603.4000000022352,"connectStart":603.4000000022352,"domainLookupEnd":603.4000000022352,"domainLookupStart":603.4000000022352,"fetchStart":603.4000000022352,"redirectEnd":0,"redirectStart":0,"requestStart":603.4000000022352,"responseEnd":865.3000000007451,"responseStart":865.3000000007451,"secureConnectionStart":603.4000000022352},{"duration":278.1000000014901,"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":603.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":603.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":881.6000000014901,"responseStart":0,"secureConnectionStart":0},{"duration":262.69999999925494,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":603.7000000029802,"connectEnd":603.7000000029802,"connectStart":603.7000000029802,"domainLookupEnd":603.7000000029802,"domainLookupStart":603.7000000029802,"fetchStart":603.7000000029802,"redirectEnd":0,"redirectStart":0,"requestStart":603.7000000029802,"responseEnd":866.4000000022352,"responseStart":866.4000000022352,"secureConnectionStart":603.7000000029802},{"duration":277.8999999985099,"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":603.9000000022352,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":603.9000000022352,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":881.8000000007451,"responseStart":0,"secureConnectionStart":0},{"duration":263.5,"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":604,"connectEnd":604,"connectStart":604,"domainLookupEnd":604,"domainLookupStart":604,"fetchStart":604,"redirectEnd":0,"redirectStart":0,"requestStart":604,"responseEnd":867.5,"responseStart":867.5,"secureConnectionStart":604},{"duration":829.4000000022352,"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":604.8000000007451,"connectEnd":604.8000000007451,"connectStart":604.8000000007451,"domainLookupEnd":604.8000000007451,"domainLookupStart":604.8000000007451,"fetchStart":604.8000000007451,"redirectEnd":0,"redirectStart":0,"requestStart":604.8000000007451,"responseEnd":1434.2000000029802,"responseStart":1434.2000000029802,"secureConnectionStart":604.8000000007451},{"duration":825.3000000007451,"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":609.3000000007451,"connectEnd":609.3000000007451,"connectStart":609.3000000007451,"domainLookupEnd":609.3000000007451,"domainLookupStart":609.3000000007451,"fetchStart":609.3000000007451,"redirectEnd":0,"redirectStart":0,"requestStart":609.3000000007451,"responseEnd":1434.6000000014901,"responseStart":1434.6000000014901,"secureConnectionStart":609.3000000007451},{"duration":465.69999999925494,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":897.9000000022352,"connectEnd":897.9000000022352,"connectStart":897.9000000022352,"domainLookupEnd":897.9000000022352,"domainLookupStart":897.9000000022352,"fetchStart":897.9000000022352,"redirectEnd":0,"redirectStart":0,"requestStart":897.9000000022352,"responseEnd":1363.6000000014901,"responseStart":1363.6000000014901,"secureConnectionStart":897.9000000022352},{"duration":282.30000000074506,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1178,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1178,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1460.300000000745,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":93,"responseStart":597,"responseEnd":601,"domLoading":600,"domInteractive":1466,"domContentLoadedEventStart":1466,"domContentLoadedEventEnd":1520,"domComplete":2586,"loadEventStart":2586,"loadEventEnd":2587,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1444.1000000014901},{"name":"bigPipe.sidebar-id.end","time":1444.9000000022352},{"name":"bigPipe.activity-panel-pipe-id.start","time":1445},{"name":"bigPipe.activity-panel-pipe-id.end","time":1447.2000000029802},{"name":"activityTabFullyLoaded","time":1528.6000000014901}],"measures":[],"correlationId":"99320431125d1f","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":444,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}