The following test case
--source include/have_innodb.inc
|
|
SET optimizer_switch='index_merge=on,index_merge_intersection=on';
|
|
CREATE TABLE t1 (
|
a INT PRIMARY KEY,
|
b INT,
|
c VARCHAR(1024) CHARACTER SET utf8,
|
d INT,
|
KEY (b)
|
) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES
|
(1, 9, 'one', 11), (2, 6, 'two', 12), (3, 2, 'three', 13), (4, 5, 'four', 14);
|
|
CREATE TABLE t2 (e INT, g INT) ENGINE=InnoDB;
|
INSERT INTO t2 VALUES (1,9), (2,6) ;
|
|
SELECT * FROM t1, t2 WHERE g = b AND ( a < 7 OR a > e );
|
|
DROP TABLE t1, t2;
|
|
produces a wrong result. It returns the right 2 rows, but values in the 2nd row are strange:
a b c d e g
|
1 9 one 11 1 9
|
2 6 0 2 6
|
There are no c='' and d=0 in the dataset, they should be 'two' and 12 instead.
bzr version-info
revision-id: timour@askmonty.org-20121022095529-87ykx0dubnj62c9y
|
date: 2012-10-22 12:55:29 +0300
|
revno: 3452
|
|
branch: ~maria-captains/maria/10.0-serg
|
Not reproducible on MariaDB 5.2 revno 3163, 5.3 revno 3587, 5.5 revno 3562, MySQL 5.6 revno 4229.
Not reproducible with t1 being a MyISAM or Aria table.
Minimal optimizer_switch: index_merge=on,index_merge_intersection=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,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=off
|
EXPLAIN (with the minimal optimizer_switch):
id select_type table type possible_keys key key_len ref rows filtered Extra
|
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
|
1 SIMPLE t1 ALL PRIMARY,b NULL NULL NULL 4 75.00 Range checked for each record (index map: 0x3)
|
Warnings:
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`e` AS `e`,`test`.`t2`.`g` AS `g` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`b` = `test`.`t2`.`g`) and ((`test`.`t1`.`a` < 7) or (`test`.`t1`.`a` > `test`.`t2`.`e`)))
|
{"report":{"fcp":812.6000001430511,"ttfb":205.10000014305115,"pageVisibility":"visible","entityId":21604,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":1,"journeyId":"7d696d2e-29a6-435f-8c54-f3a66c3001eb","navigationType":0,"readyForUser":888,"redirectCount":0,"resourceLoadedEnd":1325.9000000953674,"resourceLoadedStart":213.40000009536743,"resourceTiming":[{"duration":65.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":213.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":278.5,"responseStart":0,"secureConnectionStart":0},{"duration":65.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":213.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":278.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":133,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":213.80000019073486,"connectEnd":213.80000019073486,"connectStart":213.80000019073486,"domainLookupEnd":213.80000019073486,"domainLookupStart":213.80000019073486,"fetchStart":213.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":213.80000019073486,"responseEnd":346.80000019073486,"responseStart":346.80000019073486,"secureConnectionStart":213.80000019073486},{"duration":189.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":214,"connectEnd":214,"connectStart":214,"domainLookupEnd":214,"domainLookupStart":214,"fetchStart":214,"redirectEnd":0,"redirectStart":0,"requestStart":214,"responseEnd":403.80000019073486,"responseStart":403.80000019073486,"secureConnectionStart":214},{"duration":193.70000004768372,"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":214.10000014305115,"connectEnd":214.10000014305115,"connectStart":214.10000014305115,"domainLookupEnd":214.10000014305115,"domainLookupStart":214.10000014305115,"fetchStart":214.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":214.10000014305115,"responseEnd":407.80000019073486,"responseStart":407.80000019073486,"secureConnectionStart":214.10000014305115},{"duration":193.79999995231628,"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":214.40000009536743,"connectEnd":214.40000009536743,"connectStart":214.40000009536743,"domainLookupEnd":214.40000009536743,"domainLookupStart":214.40000009536743,"fetchStart":214.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":214.40000009536743,"responseEnd":408.2000000476837,"responseStart":408.2000000476837,"secureConnectionStart":214.40000009536743},{"duration":194.20000004768372,"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":214.5,"connectEnd":214.5,"connectStart":214.5,"domainLookupEnd":214.5,"domainLookupStart":214.5,"fetchStart":214.5,"redirectEnd":0,"redirectStart":0,"requestStart":214.5,"responseEnd":408.7000000476837,"responseStart":408.7000000476837,"secureConnectionStart":214.5},{"duration":274.39999985694885,"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":214.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":489.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":194.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":214.90000009536743,"connectEnd":214.90000009536743,"connectStart":214.90000009536743,"domainLookupEnd":214.90000009536743,"domainLookupStart":214.90000009536743,"fetchStart":214.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":214.90000009536743,"responseEnd":409.2000000476837,"responseStart":409.2000000476837,"secureConnectionStart":214.90000009536743},{"duration":274.2999999523163,"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":215.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":215.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":489.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":194.60000014305115,"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":215.20000004768372,"connectEnd":215.20000004768372,"connectStart":215.20000004768372,"domainLookupEnd":215.20000004768372,"domainLookupStart":215.20000004768372,"fetchStart":215.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":215.20000004768372,"responseEnd":409.80000019073486,"responseStart":409.80000019073486,"secureConnectionStart":215.20000004768372},{"duration":373,"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":220.5,"connectEnd":220.5,"connectStart":220.5,"domainLookupEnd":220.5,"domainLookupStart":220.5,"fetchStart":220.5,"redirectEnd":0,"redirectStart":0,"requestStart":220.5,"responseEnd":593.5,"responseStart":593.5,"secureConnectionStart":220.5},{"duration":1103.5999999046326,"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":220.80000019073486,"connectEnd":220.80000019073486,"connectStart":220.80000019073486,"domainLookupEnd":220.80000019073486,"domainLookupStart":220.80000019073486,"fetchStart":220.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":220.80000019073486,"responseEnd":1324.4000000953674,"responseStart":1324.4000000953674,"secureConnectionStart":220.80000019073486},{"duration":93.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":500.7000000476837,"connectEnd":500.7000000476837,"connectStart":500.7000000476837,"domainLookupEnd":500.7000000476837,"domainLookupStart":500.7000000476837,"fetchStart":500.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":500.7000000476837,"responseEnd":593.9000000953674,"responseStart":593.9000000953674,"secureConnectionStart":500.7000000476837},{"duration":558.9000000953674,"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","startTime":767,"connectEnd":767,"connectStart":767,"domainLookupEnd":767,"domainLookupStart":767,"fetchStart":767,"redirectEnd":0,"redirectStart":0,"requestStart":767,"responseEnd":1325.9000000953674,"responseStart":1325.9000000953674,"secureConnectionStart":767},{"duration":534.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":806,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":806,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1340.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":40,"responseStart":205,"responseEnd":220,"domLoading":211,"domInteractive":1342,"domContentLoadedEventStart":1342,"domContentLoadedEventEnd":1382,"domComplete":1842,"loadEventStart":1842,"loadEventEnd":1844,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1328.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1329},{"name":"bigPipe.activity-panel-pipe-id.start","time":1329.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1331.6000001430511},{"name":"activityTabFullyLoaded","time":1390.1000001430511}],"measures":[],"correlationId":"cd778577105923","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}