Type:
Bug
Resolution:
Fixed
Affects Version/s:
None
Fix Version/s:
None
Component/s:
None
Repeatable in maria-5.3, maria-5.3-mwl89, maria-5.3-mwl148
Backtrace:
#5 0x08333ec0 in copy_fields (param=0xae55d070) at sql_select.cc:18235
#6 0x0832cb06 in end_send_group (join=0xae5583c8, join_tab=0x0, end_of_records=false) at sql_select.cc:15135
#7 0x08329295 in do_select (join=0xae5583c8, fields=0xae55d17c, table=0x0, procedure=0x0) at sql_select.cc:13505
#8 0x0830fcdb in JOIN::exec (this=0xae5583c8) at sql_select.cc:2530
#9 0x0824058c in subselect_single_select_engine::exec (this=0xae514e18) at item_subselect.cc:2754
#10 0x0823ac0f in Item_subselect::exec (this=0xae514d18) at item_subselect.cc:537
#11 0x0823ae0e in Item_in_subselect::exec (this=0xae514d18) at item_subselect.cc:634
#12 0x0823c7f6 in Item_in_subselect::val_bool (this=0xae514d18) at item_subselect.cc:1314
#13 0x081d9138 in Item::val_bool_result (this=0xae514d18) at item.h:813
#14 0x082054d2 in Item_in_optimizer::val_int (this=0xae52b760) at item_cmpfunc.cc:1980
#15 0x081c24e4 in Item::val_bool (this=0xae52b760) at item.cc:187
#16 0x0820d42c in Item_cond_or::val_int (this=0xae5362f8) at item_cmpfunc.cc:4698
#17 0x081c24e4 in Item::val_bool (this=0xae5362f8) at item.cc:187
#18 0x0820d330 in Item_cond_and::val_int (this=0xae536248) at item_cmpfunc.cc:4680
#19 0x08329471 in do_select (join=0xae553520, fields=0xae5582bc, table=0x0, procedure=0x0) at sql_select.cc:13538
#20 0x0830fcdb in JOIN::exec (this=0xae553520) at sql_select.cc:2530
#21 0x083104f8 in mysql_select (thd=0xa92dc08, rref_pointer_array=0xa92f6a4, tables=0xae513d38, wild_num=0, fields=...,
conds=0xae52a980, og_num=1, order=0x0, group=0xae514e78, having=0x0, proc_param=0x0, select_options=2147764736,
result=0xae52b450, unit=0xa92f304, select_lex=0xa92f5a0) at sql_select.cc:2749
#22 0x08308ad7 in handle_select (thd=0xa92dc08, lex=0xa92f2a8, result=0xae52b450, setup_tables_done_option=0) at sql_select.cc:280
#23 0x082a5e25 in execute_sqlcom_select (thd=0xa92dc08, all_tables=0xae513d38) at sql_parse.cc:5090
#24 0x0829cc97 in mysql_execute_command (thd=0xa92dc08) at sql_parse.cc:2235
#25 0x082a83c8 in mysql_parse (thd=0xa92dc08,
rawbuf=0xae512eb0 "SELECT alias1.f4 AS field1\nFROM\n(\nSELECT *\nFROM t1 )\nAS alias1 JOIN t2 AS alias2 ON alias2.f1\nWHERE\n( 'i' , 'a' )\nIN\n(\nSELECT f10 , MIN( f10 )\nFROM t2 )\nOR alias2.f10 <= 'f'\nGROUP BY field1", length=189,
found_semicolon=0xae8e1228) at sql_parse.cc:6090
#26 0x0829a920 in dispatch_command (command=COM_QUERY, thd=0xa92dc08, packet=0xa9887d1 "", packet_length=189) at sql_parse.cc:1211
#27 0x08299dcd in do_command (thd=0xa92dc08) at sql_parse.cc:904
#28 0x08296e80 in handle_one_connection (arg=0xa92dc08) at sql_connect.cc:1154
#29 0x00821919 in start_thread () from /lib/libpthread.so.0
#30 0x00453cce in clone () from /lib/libc.so.6
Explain:
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1
test case:
SET SESSION optimizer_switch='index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,firstmatch=on,loosescan=on,materialization=off,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr_sort_keys=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on';
CREATE TABLE t1 ( f4 int) ;
INSERT IGNORE INTO t1 VALUES (2),(1);
CREATE TABLE t2 ( f10 int) ;
INSERT IGNORE INTO t2 VALUES (0);
SELECT t1.f4
FROM t1
WHERE ( 0 ) IN (SELECT MIN( f10 ) FROM t2 )
GROUP BY 1;
{"report":{"fcp":1191.9000000357628,"ttfb":456.9000000357628,"pageVisibility":"visible","entityId":20709,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"f76d3a02-106c-4554-adf5-2852b0fb445d","navigationType":0,"readyForUser":1255.1000000238419,"redirectCount":0,"resourceLoadedEnd":1383.7000000476837,"resourceLoadedStart":467.30000001192093,"resourceTiming":[{"duration":153.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":467.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":467.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":620.8000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":153.60000002384186,"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":467.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":467.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":621.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":208.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":467.7000000476837,"connectEnd":467.7000000476837,"connectStart":467.7000000476837,"domainLookupEnd":467.7000000476837,"domainLookupStart":467.7000000476837,"fetchStart":467.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":467.7000000476837,"responseEnd":676.5,"responseStart":676.5,"secureConnectionStart":467.7000000476837},{"duration":292.5,"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":468,"connectEnd":468,"connectStart":468,"domainLookupEnd":468,"domainLookupStart":468,"fetchStart":468,"redirectEnd":0,"redirectStart":0,"requestStart":468,"responseEnd":760.5,"responseStart":760.5,"secureConnectionStart":468},{"duration":296.19999998807907,"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":468.2000000476837,"connectEnd":468.2000000476837,"connectStart":468.2000000476837,"domainLookupEnd":468.2000000476837,"domainLookupStart":468.2000000476837,"fetchStart":468.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":468.2000000476837,"responseEnd":764.4000000357628,"responseStart":764.4000000357628,"secureConnectionStart":468.2000000476837},{"duration":296.60000002384186,"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":468.30000001192093,"connectEnd":468.30000001192093,"connectStart":468.30000001192093,"domainLookupEnd":468.30000001192093,"domainLookupStart":468.30000001192093,"fetchStart":468.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":468.30000001192093,"responseEnd":764.9000000357628,"responseStart":764.9000000357628,"secureConnectionStart":468.30000001192093},{"duration":296.69999998807907,"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":468.60000002384186,"connectEnd":468.60000002384186,"connectStart":468.60000002384186,"domainLookupEnd":468.60000002384186,"domainLookupStart":468.60000002384186,"fetchStart":468.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":468.60000002384186,"responseEnd":765.3000000119209,"responseStart":765.3000000119209,"secureConnectionStart":468.60000002384186},{"duration":350.69999998807907,"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":468.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":468.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":819.4000000357628,"responseStart":0,"secureConnectionStart":0},{"duration":296.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":468.9000000357628,"connectEnd":468.9000000357628,"connectStart":468.9000000357628,"domainLookupEnd":468.9000000357628,"domainLookupStart":468.9000000357628,"fetchStart":468.9000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":468.9000000357628,"responseEnd":765.7000000476837,"responseStart":765.7000000476837,"secureConnectionStart":468.9000000357628},{"duration":350.60000002384186,"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":469,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":469,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":819.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":297.0999999642372,"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":469.2000000476837,"connectEnd":469.2000000476837,"connectStart":469.2000000476837,"domainLookupEnd":469.2000000476837,"domainLookupStart":469.2000000476837,"fetchStart":469.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":469.2000000476837,"responseEnd":766.3000000119209,"responseStart":766.3000000119209,"secureConnectionStart":469.2000000476837},{"duration":436.5,"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":469.80000001192093,"connectEnd":469.80000001192093,"connectStart":469.80000001192093,"domainLookupEnd":469.80000001192093,"domainLookupStart":469.80000001192093,"fetchStart":469.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":469.80000001192093,"responseEnd":906.3000000119209,"responseStart":906.3000000119209,"secureConnectionStart":469.80000001192093},{"duration":913.0999999642372,"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":469.9000000357628,"connectEnd":469.9000000357628,"connectStart":469.9000000357628,"domainLookupEnd":469.9000000357628,"domainLookupStart":469.9000000357628,"fetchStart":469.9000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":469.9000000357628,"responseEnd":1383,"responseStart":1383,"secureConnectionStart":469.9000000357628},{"duration":75.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":831.3000000119209,"connectEnd":831.3000000119209,"connectStart":831.3000000119209,"domainLookupEnd":831.3000000119209,"domainLookupStart":831.3000000119209,"fetchStart":831.3000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":831.3000000119209,"responseEnd":906.8000000119209,"responseStart":906.8000000119209,"secureConnectionStart":831.3000000119209},{"duration":290.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/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","startTime":1093.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1093.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1383.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":353.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/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","startTime":1094.4000000357628,"connectEnd":1094.4000000357628,"connectStart":1094.4000000357628,"domainLookupEnd":1094.4000000357628,"domainLookupStart":1094.4000000357628,"fetchStart":1094.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":1094.4000000357628,"responseEnd":1447.6000000238419,"responseStart":1447.6000000238419,"secureConnectionStart":1094.4000000357628},{"duration":357,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/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","startTime":1094.800000011921,"connectEnd":1094.800000011921,"connectStart":1094.800000011921,"domainLookupEnd":1094.800000011921,"domainLookupStart":1094.800000011921,"fetchStart":1094.800000011921,"redirectEnd":0,"redirectStart":0,"requestStart":1094.800000011921,"responseEnd":1451.800000011921,"responseStart":1451.800000011921,"secureConnectionStart":1094.800000011921}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":306,"responseStart":457,"responseEnd":463,"domLoading":465,"domInteractive":1406,"domContentLoadedEventStart":1406,"domContentLoadedEventEnd":1449,"domComplete":2411,"loadEventStart":2412,"loadEventEnd":2412,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1384.800000011921},{"name":"bigPipe.sidebar-id.end","time":1385.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1385.800000011921},{"name":"bigPipe.activity-panel-pipe-id.end","time":1387.1000000238419},{"name":"activityTabFullyLoaded","time":1463.9000000357628}],"measures":[],"correlationId":"c6a36836a35c6b","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Re: Second crash in copy_fields() in maria-5.3
Also repeatable without any 0 or 1 literals:
CREATE TABLE t1 ( f4 int) ;
INSERT IGNORE INTO t1 VALUES (3),(4);
CREATE TABLE t2 ( f10 int) ;
INSERT IGNORE INTO t2 VALUES (2);
SELECT t1.f4
FROM t1
WHERE ( 2 ) IN (SELECT MIN( f10 ) FROM t2 )
GROUP BY 1;