ALTER TABLE CHANGE COLUMN Corrupts Index Leading to Crashes in 10.2
Run the following test in 10.2.9 (tested 10.2.6 through 10.2.9) and it will crash:
CREATE DATABASE IF NOT EXISTS `crashtest`;
|
USE `crashtest`;
|
drop table if exists t1;
|
CREATE TABLE `t1` (
|
`id1` INT(11) NOT NULL AUTO_INCREMENT,
|
`id2` VARCHAR(30) NOT NULL,
|
`id3` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
PRIMARY KEY (`id1`),
|
UNIQUE KEY `unique_id2` (`id2`)
|
);
|
ALTER TABLE `t1` CHANGE COLUMN `id2` `id4` VARCHAR(100) NOT NULL;
|
SELECT * FROM `t1` where id4 like 'a';
|
MariaDB [crashtest]> SELECT * FROM `t1` where id4 like 'a';
|
ERROR 2013 (HY000): Lost connection to MySQL server during query
|
This does not crash in 10.1.28.
Note that If I remove id3 (the column after id2 - the one being changed), then it does not crash:
CREATE DATABASE IF NOT EXISTS `crashtest`;
|
USE `crashtest`;
|
drop table if exists t1;
|
CREATE TABLE `t1` (
|
`id1` INT(11) NOT NULL AUTO_INCREMENT,
|
`id2` VARCHAR(30) NOT NULL,
|
PRIMARY KEY (`id1`),
|
UNIQUE KEY `unique_id2` (`id2`)
|
);
|
ALTER TABLE `t1` CHANGE COLUMN `id2` `id4` VARCHAR(100) NOT NULL;
|
SELECT * FROM `t1` where id4 like 'a';
|
Here is the error log stack trace:
2017-10-16 18:25:48 25472 [Note] C:\Program Files\MariaDB 10.2\bin\mysqld.exe: ready for connections.
|
Version: '10.2.9-MariaDB' socket: '' port: 3317 mariadb.org binary distribution
|
2017-10-16 18:25:48 35452 [Note] InnoDB: Buffer pool(s) load completed at 171016 18:25:48
|
2017-10-16 18:26:47 29244 [ERROR] Found index unique_id2 whose column info does not match that of MariaDB.
|
2017-10-16 18:26:47 29244 [ERROR] Build InnoDB index translation table for Table .\crashtest\t1 failed
|
171016 18:26:47 [ERROR] mysqld got exception 0xc0000005 ;
|
This could be because you hit a bug. It is also possible that this binary
|
or one of the libraries it was linked against is corrupt, improperly built,
|
or misconfigured. This error can also be caused by malfunctioning hardware.
|
|
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
|
|
We will try our best to scrape up some info that will hopefully help
|
diagnose the problem, but since we have already crashed,
|
something is definitely wrong and this may fail.
|
|
Server version: 10.2.9-MariaDB
|
key_buffer_size=134217728
|
read_buffer_size=131072
|
max_used_connections=1
|
max_threads=65537
|
thread_count=7
|
It is possible that mysqld could use up to
|
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136039 K bytes of memory
|
Hope that's ok; if not, decrease some variables in the equation.
|
|
Thread pointer: 0x11f13258
|
Attempting backtrace. You can use the following information to find out
|
where mysqld died. If you see no messages after this, something went
|
terribly wrong...
|
mysqld.exe!my_xml_error_string()
|
mysqld.exe!?get_tok_start_prev@Lex_input_stream@@QEAAPEBDXZ()
|
mysqld.exe!?ha_index_read_map@handler@@QEAAHPEAEPEBEKW4ha_rkey_function@@@Z()
|
mysqld.exe!?read_range_first@handler@@UEAAHPEBUst_key_range@@0_N1@Z()
|
mysqld.exe!?multi_range_read_next@handler@@UEAAHPEAPEAX@Z()
|
mysqld.exe!?get_next@Mrr_simple_index_reader@@UEAAHPEAPEAX@Z()
|
mysqld.exe!?dsmrr_next@DsMrr_impl@@QEAAHPEAPEAX@Z()
|
mysqld.exe!?get_next@QUICK_RANGE_SELECT@@UEAAHXZ()
|
mysqld.exe!?rr_from_pointers@@YAHPEAUREAD_RECORD@@@Z()
|
mysqld.exe!?sub_select@@YA?AW4enum_nested_loop_state@@PEAVJOIN@@PEAUst_join_table@@_N@Z()
|
mysqld.exe!?disjoin@?$List@VItem@@@@QEAAXPEAV1@@Z()
|
mysqld.exe!?exec_inner@JOIN@@QEAAXXZ()
|
mysqld.exe!?exec@JOIN@@QEAAXXZ()
|
mysqld.exe!?mysql_select@@YA_NPEAVTHD@@PEAUTABLE_LIST@@IAEAV?$List@VItem@@@@PEAVItem@@IPEAUst_order@@434_KPEAVselect_result@@PEAVst_select_lex_unit@@PEAVst_select_lex@@@Z()
|
mysqld.exe!?handle_select@@YA_NPEAVTHD@@PEAULEX@@PEAVselect_result@@K@Z()
|
mysqld.exe!?execute_init_command@@YAXPEAVTHD@@PEAUst_mysql_lex_string@@PEAUst_mysql_rwlock@@@Z()
|
mysqld.exe!?mysql_execute_command@@YAHPEAVTHD@@@Z()
|
mysqld.exe!?mysql_parse@@YAXPEAVTHD@@PEADIPEAVParser_state@@_N3@Z()
|
mysqld.exe!?dispatch_command@@YA_NW4enum_server_command@@PEAVTHD@@PEADI_N3@Z()
|
mysqld.exe!?do_command@@YA_NPEAVTHD@@@Z()
|
mysqld.exe!?pool_of_threads_scheduler@@YAXPEAUscheduler_functions@@PEAKPEAI@Z()
|
mysqld.exe!?tp_callback@@YAXPEAUTP_connection@@@Z()
|
ntdll.dll!TpPostWork()
|
ntdll.dll!TpDisassociateCallback()
|
kernel32.dll!BaseThreadInitThunk()
|
ntdll.dll!RtlUserThreadStart()
|
|
Trying to get some variables.
|
Some pointers may be invalid and cause the dump to abort.
|
Query (0x11f1fc40): SELECT * FROM `t1` where id4 like 'a'
|
Connection ID (thread ID): 9
|
Status: NOT_KILLED
|
|
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
|
|
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
|
information that should help you find out what is causing the crash.
|
2017-10-16 18:27:04 26064 [Note] InnoDB: page_cleaner: 1000ms intended loop took 5733ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
|
{"report":{"fcp":913.6000000238419,"ttfb":351.30000001192093,"pageVisibility":"visible","entityId":63617,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"60f4bf49-28fe-412c-ab12-97c881dec9cb","navigationType":0,"readyForUser":999.6000000238419,"redirectCount":0,"resourceLoadedEnd":654.2000000476837,"resourceLoadedStart":358.7000000476837,"resourceTiming":[{"duration":26.599999964237213,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":358.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":358.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":385.30000001192093,"responseStart":0,"secureConnectionStart":0},{"duration":26.80000001192093,"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":358.9000000357628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":358.9000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":385.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":140.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":359.10000002384186,"connectEnd":359.10000002384186,"connectStart":359.10000002384186,"domainLookupEnd":359.10000002384186,"domainLookupStart":359.10000002384186,"fetchStart":359.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":388.7000000476837,"responseEnd":499.30000001192093,"responseStart":402.9000000357628,"secureConnectionStart":359.10000002384186},{"duration":258.60000002384186,"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":359.30000001192093,"connectEnd":359.30000001192093,"connectStart":359.30000001192093,"domainLookupEnd":359.30000001192093,"domainLookupStart":359.30000001192093,"fetchStart":359.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":392.60000002384186,"responseEnd":617.9000000357628,"responseStart":408.2000000476837,"secureConnectionStart":359.30000001192093},{"duration":56,"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":359.5,"connectEnd":359.5,"connectStart":359.5,"domainLookupEnd":359.5,"domainLookupStart":359.5,"fetchStart":359.5,"redirectEnd":0,"redirectStart":0,"requestStart":392.9000000357628,"responseEnd":415.5,"responseStart":411.60000002384186,"secureConnectionStart":359.5},{"duration":57.19999998807907,"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":359.60000002384186,"connectEnd":359.60000002384186,"connectStart":359.60000002384186,"domainLookupEnd":359.60000002384186,"domainLookupStart":359.60000002384186,"fetchStart":359.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":393.30000001192093,"responseEnd":416.80000001192093,"responseStart":412.30000001192093,"secureConnectionStart":359.60000002384186},{"duration":57.5,"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":359.80000001192093,"connectEnd":359.80000001192093,"connectStart":359.80000001192093,"domainLookupEnd":359.80000001192093,"domainLookupStart":359.80000001192093,"fetchStart":359.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":393.7000000476837,"responseEnd":417.30000001192093,"responseStart":415.7000000476837,"secureConnectionStart":359.80000001192093},{"duration":33.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":360,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":360,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":393.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":58.59999996423721,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":360.2000000476837,"connectEnd":360.2000000476837,"connectStart":360.2000000476837,"domainLookupEnd":360.2000000476837,"domainLookupStart":360.2000000476837,"fetchStart":360.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":397.80000001192093,"responseEnd":418.80000001192093,"responseStart":417.5,"secureConnectionStart":360.2000000476837},{"duration":34.30000001192093,"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":360.4000000357628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":360.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":394.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":60.90000003576279,"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":360.5,"connectEnd":360.5,"connectStart":360.5,"domainLookupEnd":360.5,"domainLookupStart":360.5,"fetchStart":360.5,"redirectEnd":0,"redirectStart":0,"requestStart":399.60000002384186,"responseEnd":421.4000000357628,"responseStart":419,"secureConnectionStart":360.5},{"duration":287,"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":366.2000000476837,"connectEnd":366.2000000476837,"connectStart":366.2000000476837,"domainLookupEnd":366.2000000476837,"domainLookupStart":366.2000000476837,"fetchStart":366.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":439.80000001192093,"responseEnd":653.2000000476837,"responseStart":646.1000000238419,"secureConnectionStart":366.2000000476837},{"duration":283.60000002384186,"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":370.60000002384186,"connectEnd":370.60000002384186,"connectStart":370.60000002384186,"domainLookupEnd":370.60000002384186,"domainLookupStart":370.60000002384186,"fetchStart":370.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":473.5,"responseEnd":654.2000000476837,"responseStart":647.7000000476837,"secureConnectionStart":370.60000002384186},{"duration":89.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":639.2000000476837,"connectEnd":639.2000000476837,"connectStart":639.2000000476837,"domainLookupEnd":639.2000000476837,"domainLookupStart":639.2000000476837,"fetchStart":639.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":692.6000000238419,"responseEnd":728.7000000476837,"responseStart":727.9000000357628,"secureConnectionStart":639.2000000476837},{"duration":206.9000000357628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":837.3000000119209,"connectEnd":837.3000000119209,"connectStart":837.3000000119209,"domainLookupEnd":837.3000000119209,"domainLookupStart":837.3000000119209,"fetchStart":837.3000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":1006.4000000357628,"responseEnd":1044.2000000476837,"responseStart":1043.5,"secureConnectionStart":837.3000000119209}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":157,"responseStart":352,"responseEnd":371,"domLoading":355,"domInteractive":1064,"domContentLoadedEventStart":1064,"domContentLoadedEventEnd":1110,"domComplete":1390,"loadEventStart":1390,"loadEventEnd":1391,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1040.300000011921},{"name":"bigPipe.sidebar-id.end","time":1041},{"name":"bigPipe.activity-panel-pipe-id.start","time":1041.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":1042.4000000357628},{"name":"activityTabFullyLoaded","time":1127.7000000476837}],"measures":[],"correlationId":"57baf209ad71aa","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":109,"dbReadsTimeInMs":20,"dbConnsTimeInMs":29,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}