Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
10.1.17 , 10.0.27 , 5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL)
Sprint:
10.2.6-3, 10.3.1-1
GROUP BY queries from MyISAM tables consistently fails with 'TABLE FULL' for some lengths of fields being grouped but succeeds for longer lengths. Does not appear to be hitting operating system limits.
For example, with a source MyISAM table 'test.input' of 10m records defined as field a=int(11) auto-increment primary key (values 1-10,000,000) and field b defined as varchar(128) not null and randomly filled, then the following fail but any other length (1-127) runs OK:
create table test.test as select a, RIGHT (b,62) as b, count (1) as x from test.input group by 1, 2;
create table test.test as select a, RIGHT (b,63) as b, count (1) as x from test.input group by 1, 2;
create table test.test as select a, RIGHT (b,80) as b, count (1) as x from test.input group by 1, 2;
create table test.test as select a, RIGHT (b,81) as b, count (1) as x from test.input group by 1, 2;
Replacing the length with @len causes the crash to occur with values of @len that are 1 lower than the lengths above: i.e. @len=61, 62, 79 and 80.
While the query is running, a pair of files (.MAI, .MAD) are being created in /tmp; the query crashes at the point that the .MAI file is about the exceed 512Mb. For other lengths the .MAI file exceeds 512Mb without crashing. /tmp has over 404Gb free space available.
None of the conditions documented at http://dev.mysql.com/doc/refman/5.5/en/table-size-limit.html apply in this case - plenty of disk space, query runs OK with longer values being grouped, not using InnoDB, file size is suitable for pointer size, etc.
The solution listed elsewhere for specifying MAX_ROWS is for when explicitly creating an Aria table; MariaDB is implicitly creating the table so cannot specify MAX_ROWS. In any cases, 10m rows is not excessive.
Table input:
Name: input
Engine: MyISAM
Version: 10
Row_format: Dynamic
Rows: 10000000
Avg_row_length: 140
Data_length: 1400000000
Max_data_length: 281474976710655
Index_length: 102784000
Data_free: 0
Auto_increment: 10000001
Create_time: 2017-01-18 11:53:34
Update_time: 2017-01-18 11:54:14
Check_time: NULL
Collation: latin1_swedish_ci
Checksum: NULL
Create_options:
Comment:
Table input created and populated as:
drop table if exists test.input;
create table test.input (
a integer not null auto_increment primary key ,
b varchar (128) not null );
insert into test.input (b) values (REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16));
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input;
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input; -- 2^13 8388608
insert into test.input (b) select REPEAT(LPAD( CAST (RAND()*100000000 AS INTEGER ), 8, '0' ),16) from test.input where a<=1611392; -- 10m records
Selected settings:
aria_block_size 8192
aria_log_file_size 1073741824
aria_max_sort_file_size 9223372036853727232
aria_pagecache_buffer_size 134217728
aria_sort_buffer_size 268434432
aria_used_for_temp_tables ON
character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_results utf8
collation_connection latin1_swedish_ci
collation_server latin1_swedish_ci
default_storage_engine MyISAM
default_tmp_storage_engine (blank)
innodb_data_file_path ibdata1:12M:autoextend (NB: Not using Innodb)
key_buffer_size 4294967296
max_heap_table_size 16777216
myisam_block_size 1024
myisam_sort_buffer_size 134217728
sort_buffer_size 2097152
sql_big_selects ON
version 10.0.27-MariaDB (server A), 10.1.17-MariaDB (server B)
version_compile_machine x86_64
version_compile_os Linux
{"report":{"fcp":1161.3999996185303,"ttfb":347.3999996185303,"pageVisibility":"visible","entityId":59884,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"3cb8f15a-c981-4ee4-98e0-ba5828c22a7e","navigationType":0,"readyForUser":1347.1999998092651,"redirectCount":0,"resourceLoadedEnd":1595.5,"resourceLoadedStart":355.5999994277954,"resourceTiming":[{"duration":258.70000076293945,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":355.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":614.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":259.19999980926514,"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":355.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":615,"responseStart":0,"secureConnectionStart":0},{"duration":288.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":356.0999994277954,"connectEnd":356.0999994277954,"connectStart":356.0999994277954,"domainLookupEnd":356.0999994277954,"domainLookupStart":356.0999994277954,"fetchStart":356.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":356.0999994277954,"responseEnd":644.5,"responseStart":644.5,"secureConnectionStart":356.0999994277954},{"duration":383.80000019073486,"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":356.19999980926514,"connectEnd":356.19999980926514,"connectStart":356.19999980926514,"domainLookupEnd":356.19999980926514,"domainLookupStart":356.19999980926514,"fetchStart":356.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":356.19999980926514,"responseEnd":740,"responseStart":740,"secureConnectionStart":356.19999980926514},{"duration":387.9000005722046,"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":356.3999996185303,"connectEnd":356.3999996185303,"connectStart":356.3999996185303,"domainLookupEnd":356.3999996185303,"domainLookupStart":356.3999996185303,"fetchStart":356.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":356.3999996185303,"responseEnd":744.3000001907349,"responseStart":744.3000001907349,"secureConnectionStart":356.3999996185303},{"duration":388.20000076293945,"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":356.5999994277954,"connectEnd":356.5999994277954,"connectStart":356.5999994277954,"domainLookupEnd":356.5999994277954,"domainLookupStart":356.5999994277954,"fetchStart":356.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":356.5999994277954,"responseEnd":744.8000001907349,"responseStart":744.8000001907349,"secureConnectionStart":356.5999994277954},{"duration":388.5,"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":356.80000019073486,"connectEnd":356.80000019073486,"connectStart":356.80000019073486,"domainLookupEnd":356.80000019073486,"domainLookupStart":356.80000019073486,"fetchStart":356.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":356.80000019073486,"responseEnd":745.3000001907349,"responseStart":745.3000001907349,"secureConnectionStart":356.80000019073486},{"duration":435.5999994277954,"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":357,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":357,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":792.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":388.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":357.19999980926514,"connectEnd":357.19999980926514,"connectStart":357.19999980926514,"domainLookupEnd":357.19999980926514,"domainLookupStart":357.19999980926514,"fetchStart":357.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":357.19999980926514,"responseEnd":745.6999998092651,"responseStart":745.6999998092651,"secureConnectionStart":357.19999980926514},{"duration":435.4000005722046,"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":357.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":357.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":792.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":388.80000019073486,"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":357.5999994277954,"connectEnd":357.5999994277954,"connectStart":357.5999994277954,"domainLookupEnd":357.5999994277954,"domainLookupStart":357.5999994277954,"fetchStart":357.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":357.5999994277954,"responseEnd":746.3999996185303,"responseStart":746.3999996185303,"secureConnectionStart":357.5999994277954},{"duration":1187.5,"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":373.5999994277954,"connectEnd":373.5999994277954,"connectStart":373.5999994277954,"domainLookupEnd":373.5999994277954,"domainLookupStart":373.5999994277954,"fetchStart":373.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":373.5999994277954,"responseEnd":1561.0999994277954,"responseStart":1561.0999994277954,"secureConnectionStart":373.5999994277954},{"duration":1189,"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":373.69999980926514,"connectEnd":373.69999980926514,"connectStart":373.69999980926514,"domainLookupEnd":373.69999980926514,"domainLookupStart":373.69999980926514,"fetchStart":373.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":373.69999980926514,"responseEnd":1562.6999998092651,"responseStart":1562.6999998092651,"secureConnectionStart":373.69999980926514},{"duration":130.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":812.0999994277954,"connectEnd":812.0999994277954,"connectStart":812.0999994277954,"domainLookupEnd":812.0999994277954,"domainLookupStart":812.0999994277954,"fetchStart":812.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":812.0999994277954,"responseEnd":942.5999994277954,"responseStart":942.5999994277954,"secureConnectionStart":812.0999994277954},{"duration":481.20000076293945,"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":1082.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1082.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1563.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":506.5,"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":1083.5,"connectEnd":1083.5,"connectStart":1083.5,"domainLookupEnd":1083.5,"domainLookupStart":1083.5,"fetchStart":1083.5,"redirectEnd":0,"redirectStart":0,"requestStart":1083.5,"responseEnd":1590,"responseStart":1590,"secureConnectionStart":1083.5},{"duration":519.9000005722046,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1150.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1150.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1670.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":511.5,"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":1084,"connectEnd":1084,"connectStart":1084,"domainLookupEnd":1084,"domainLookupStart":1084,"fetchStart":1084,"redirectEnd":0,"redirectStart":0,"requestStart":1084,"responseEnd":1595.5,"responseStart":1595.5,"secureConnectionStart":1084}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":170,"responseStart":348,"responseEnd":371,"domLoading":353,"domInteractive":1598,"domContentLoadedEventStart":1598,"domContentLoadedEventEnd":1669,"domComplete":2772,"loadEventStart":2772,"loadEventEnd":2774,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1567.8000001907349},{"name":"bigPipe.sidebar-id.end","time":1568.5999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1568.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1571.1999998092651},{"name":"activityTabFullyLoaded","time":1679.1999998092651}],"measures":[],"correlationId":"f69efbe5387634","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":102,"dbReadsTimeInMs":11,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}