Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
None
Fix Version/s:
None
Component/s:
None
mysqld: protocol.cc:509: void net_end_statement(THD*): Assertion `0' failed.
120216 1:46:27 [ERROR] mysqld got signal 6 ;
#8 0xb74a3014 in __assert_fail () from /lib/libc.so.6
#9 0x082c50ed in net_end_statement (thd=0x93efc00) at protocol.cc:509
#10 0x082e25cc in dispatch_command (command=COM_QUERY, thd=0x93efc00,
packet=0x9449561 "SELECT DISTINCT a AS field1 FROM t1, t2 \nWHERE EXISTS ( \nSELECT c FROM t3 RIGHT JOIN t2 ON b = d \n) \nHAVING field1 > 8 \nLIMIT_ROWS_EXAMINED 20", packet_length=142)
at sql_parse.cc:1620
#11 0x082e0a27 in do_command (thd=0x93efc00) at sql_parse.cc:923
#12 0x082dd9ad in handle_one_connection (arg=0x93efc00) at sql_connect.cc:1193
Query (0x945f7c8): SELECT DISTINCT a AS field1 FROM t1, t2 WHERE EXISTS ( SELECT c FROM t3 LEFT JOIN t2 ON b = d ) HAVING field1 > 8 LIMIT_ROWS_EXAMINED 20
Connection ID (thread ID): 1
Status: NOT_KILLED
Could not reproduce on the same query without LIMIT_ROWS_EXAMINED.
bzr version-info
revision-id: timour@askmonty.org-20120213145248-tlvsd794o83odf2r
date: 2012-02-13 16:52:48 +0200
build-date: 2012-02-16 01:48:07 +0400
revno: 3417
EXPLAIN:
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 Using temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Distinct
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00
2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select distinct 'USA' AS `field1` from `test`.`t1` join `test`.`t2` where exists(select `test`.`t3`.`c` from `test`.`t3` left join `test`.`t2` on((`test`.`t2`.`b` = `test`.`t3`.`d`)) where 1) having (`field1` > 8)
Minimal optimizer_switch: in_to_exists=on,outer_join_with_cache=on
Full optimizer_switch (default): 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,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
Test case:
SET optimizer_switch='in_to_exists=on,outer_join_with_cache=on';
CREATE TABLE t1 ( a VARCHAR(3) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('USA');
CREATE TABLE t2 ( b INT );
INSERT INTO t2 VALUES
(3899),(3914),(3888);
CREATE TABLE t3 ( c VARCHAR(33), d INT );
INSERT INTO t3 VALUES
('USASpanish',8),('USATagalog',0),('USAVietnamese',0);
SELECT DISTINCT a AS field1 FROM t1, t2
WHERE EXISTS (
SELECT c FROM t3 LEFT JOIN t2 ON b = d
)
HAVING field1 > 8
LIMIT_ROWS_EXAMINED 20;
# End of test case
relates to
MDEV-28
LIMIT ROWS EXAMINED clause to limit the number of rows examined during SELECT processing
Closed
{"report":{"fcp":1144.1999998092651,"ttfb":258.69999980926514,"pageVisibility":"visible","entityId":10725,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"7f23add7-e24f-4bff-935f-c0faa70fc4c9","navigationType":0,"readyForUser":1211,"redirectCount":0,"resourceLoadedEnd":1384.3000001907349,"resourceLoadedStart":263.80000019073486,"resourceTiming":[{"duration":197.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":263.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":263.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":461.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":197.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":264.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":264.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":461.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":218.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":264.19999980926514,"connectEnd":264.19999980926514,"connectStart":264.19999980926514,"domainLookupEnd":264.19999980926514,"domainLookupStart":264.19999980926514,"fetchStart":264.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":264.19999980926514,"responseEnd":482.6000003814697,"responseStart":482.6000003814697,"secureConnectionStart":264.19999980926514},{"duration":564.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":264.4000005722046,"connectEnd":264.4000005722046,"connectStart":264.4000005722046,"domainLookupEnd":264.4000005722046,"domainLookupStart":264.4000005722046,"fetchStart":264.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":264.4000005722046,"responseEnd":829.3000001907349,"responseStart":829.3000001907349,"secureConnectionStart":264.4000005722046},{"duration":568.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":264.6000003814697,"connectEnd":264.6000003814697,"connectStart":264.6000003814697,"domainLookupEnd":264.6000003814697,"domainLookupStart":264.6000003814697,"fetchStart":264.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":264.6000003814697,"responseEnd":833.1999998092651,"responseStart":833.1999998092651,"secureConnectionStart":264.6000003814697},{"duration":569.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":264.69999980926514,"connectEnd":264.69999980926514,"connectStart":264.69999980926514,"domainLookupEnd":264.69999980926514,"domainLookupStart":264.69999980926514,"fetchStart":264.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":264.69999980926514,"responseEnd":833.8000001907349,"responseStart":833.8000001907349,"secureConnectionStart":264.69999980926514},{"duration":569.2999992370605,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":264.9000005722046,"connectEnd":264.9000005722046,"connectStart":264.9000005722046,"domainLookupEnd":264.9000005722046,"domainLookupStart":264.9000005722046,"fetchStart":264.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":264.9000005722046,"responseEnd":834.1999998092651,"responseStart":834.1999998092651,"secureConnectionStart":264.9000005722046},{"duration":569.8999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":265.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":265.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":835,"responseStart":0,"secureConnectionStart":0},{"duration":569.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":265.30000019073486,"connectEnd":265.30000019073486,"connectStart":265.30000019073486,"domainLookupEnd":265.30000019073486,"domainLookupStart":265.30000019073486,"fetchStart":265.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":265.30000019073486,"responseEnd":834.6000003814697,"responseStart":834.6000003814697,"secureConnectionStart":265.30000019073486},{"duration":569.6999998092651,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":265.4000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":265.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":835.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":569.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":265.6000003814697,"connectEnd":265.6000003814697,"connectStart":265.6000003814697,"domainLookupEnd":265.6000003814697,"domainLookupStart":265.6000003814697,"fetchStart":265.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":265.6000003814697,"responseEnd":835.3000001907349,"responseStart":835.3000001907349,"secureConnectionStart":265.6000003814697},{"duration":1111.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":271.1000003814697,"connectEnd":271.1000003814697,"connectStart":271.1000003814697,"domainLookupEnd":271.1000003814697,"domainLookupStart":271.1000003814697,"fetchStart":271.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":271.1000003814697,"responseEnd":1382.9000005722046,"responseStart":1382.9000005722046,"secureConnectionStart":271.1000003814697},{"duration":1112.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":271.19999980926514,"connectEnd":271.19999980926514,"connectStart":271.19999980926514,"domainLookupEnd":271.19999980926514,"domainLookupStart":271.19999980926514,"fetchStart":271.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":271.19999980926514,"responseEnd":1383.5,"responseStart":1383.5,"secureConnectionStart":271.19999980926514},{"duration":370.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":628.6999998092651,"connectEnd":628.6999998092651,"connectStart":628.6999998092651,"domainLookupEnd":628.6999998092651,"domainLookupStart":628.6999998092651,"fetchStart":628.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":628.6999998092651,"responseEnd":999.1999998092651,"responseStart":999.1999998092651,"secureConnectionStart":628.6999998092651},{"duration":283.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&slack-enabled=true","startTime":1100.6000003814697,"connectEnd":1100.6000003814697,"connectStart":1100.6000003814697,"domainLookupEnd":1100.6000003814697,"domainLookupStart":1100.6000003814697,"fetchStart":1100.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":1100.6000003814697,"responseEnd":1384.3000001907349,"responseStart":1384.3000001907349,"secureConnectionStart":1100.6000003814697},{"duration":247.80000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1137.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1137.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1385.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":89,"responseStart":259,"responseEnd":267,"domLoading":262,"domInteractive":1408,"domContentLoadedEventStart":1408,"domContentLoadedEventEnd":1451,"domComplete":1858,"loadEventStart":1858,"loadEventEnd":1859,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1387.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1388.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1388.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1389.9000005722046},{"name":"activityTabFullyLoaded","time":1464.5}],"measures":[],"correlationId":"a140f90ab6e062","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":14,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A simpler test case:
SELECT DISTINCT a FROM t1, t2 HAVING a > ' ' LIMIT_ROWS_EXAMINED 2;