Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
Component/s:
None
It is most likely a regression introduced (or made visible) by the following revision:
revno: 3628
revision-id: igor@askmonty.org-20130225031611-jk8lyhhjazov66qc
committer: Igor Babaev <igor@askmonty.org>
message:
Fixed bug mdev-4177
I cannot verify it with 100% certainty because the provided test case causes a crash on revisions 3628..3634; but it produces a correct result on maria/5.3 up to revno 3627 and a wrong result starting from revno 3635 and up to (and including) the current 3646.
Also reproducible on current maria/5.5.
Test case:
CREATE TABLE t1 (a INT , b INT ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,101),(2,102),(3,103),(4,104),(5, NULL );
SELECT * FROM t1
WHERE ( NULL OR a = 5 ) AND ( b != 1 OR a = 1 );
Actual result:
Expected result - empty set:
Inconsistency of the actual result can be confirmed by executing the second part of AND separately:
SELECT * FROM t1
WHERE b != 1 OR a = 1;
a b
1 101
2 102
3 103
4 104
It is a correct result, and it doesn't include the row with a=5, so the result set for the bigger query cannot include it either (but currently it does).
Reproducible with the default optimizer_switch as well as with all OFF values.
EXPLAIN:
EXPLAIN EXTENDED
SELECT * FROM t1
WHERE ( NULL OR a = 5 ) AND ( b != 1 OR a = 1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = 5) and ((`test`.`t1`.`b` <> 1) or 1))
Elena Stepanova
made changes -
2013-04-03 01:55
Field
Original Value
New Value
Link
This issue relates to TODO-60
[ TODO-60
]
Sergei Golubchik
made changes -
2013-04-28 16:58
Fix Version/s
10.0.3
[ 12900
]
Fix Version/s
10.0.2
[ 11900
]
Igor Babaev (Inactive)
made changes -
2013-05-08 18:24
Fix Version/s
5.5.32
[ 13000
]
Fix Version/s
5.5.31
[ 12700
]
Sergei Golubchik
made changes -
2013-06-04 15:39
Fix Version/s
10.0.4
[ 13101
]
Fix Version/s
10.0.3
[ 12900
]
Igor Babaev (Inactive)
made changes -
2013-06-05 17:22
Fix Version/s
10.0.5
[ 13201
]
Fix Version/s
10.0.4
[ 13101
]
Sergei Golubchik
made changes -
2013-07-18 19:39
Fix Version/s
5.5.33
[ 13300
]
Fix Version/s
5.5.32
[ 13000
]
Sergei Golubchik
made changes -
2014-06-13 15:06
Workflow
defaullt
[ 26843
]
MariaDB v2
[ 44151
]
Sergei Golubchik
made changes -
2021-12-06 21:38
Workflow
MariaDB v3
[ 64250
]
MariaDB v4
[ 146576
]
{"report":{"fcp":1398,"ttfb":510,"pageVisibility":"visible","entityId":23541,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"1f853b7c-a65a-4a42-823a-91a0bdf43531","navigationType":0,"readyForUser":1471,"redirectCount":0,"resourceLoadedEnd":953.7000000476837,"resourceLoadedStart":515.5999999046326,"resourceTiming":[{"duration":364.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":515.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":515.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":879.8999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":364.2000000476837,"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":516,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":516,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":880.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":373.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":516.0999999046326,"connectEnd":516.0999999046326,"connectStart":516.0999999046326,"domainLookupEnd":516.0999999046326,"domainLookupStart":516.0999999046326,"fetchStart":516.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":516.0999999046326,"responseEnd":889.5999999046326,"responseStart":889.5999999046326,"secureConnectionStart":516.0999999046326},{"duration":399.2000000476837,"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":516.3999998569489,"connectEnd":516.3999998569489,"connectStart":516.3999998569489,"domainLookupEnd":516.3999998569489,"domainLookupStart":516.3999998569489,"fetchStart":516.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":516.3999998569489,"responseEnd":915.5999999046326,"responseStart":915.5999999046326,"secureConnectionStart":516.3999998569489},{"duration":403.09999990463257,"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":516.5,"connectEnd":516.5,"connectStart":516.5,"domainLookupEnd":516.5,"domainLookupStart":516.5,"fetchStart":516.5,"redirectEnd":0,"redirectStart":0,"requestStart":516.5,"responseEnd":919.5999999046326,"responseStart":919.5999999046326,"secureConnectionStart":516.5},{"duration":403.2999999523163,"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":516.7999999523163,"connectEnd":516.7999999523163,"connectStart":516.7999999523163,"domainLookupEnd":516.7999999523163,"domainLookupStart":516.7999999523163,"fetchStart":516.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":516.7999999523163,"responseEnd":920.0999999046326,"responseStart":920,"secureConnectionStart":516.7999999523163},{"duration":403.60000014305115,"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":516.8999998569489,"connectEnd":516.8999998569489,"connectStart":516.8999998569489,"domainLookupEnd":516.8999998569489,"domainLookupStart":516.8999998569489,"fetchStart":516.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":516.8999998569489,"responseEnd":920.5,"responseStart":920.5,"secureConnectionStart":516.8999998569489},{"duration":404.2999999523163,"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":517.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":517.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":921.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":403.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":517.2000000476837,"connectEnd":517.2000000476837,"connectStart":517.2000000476837,"domainLookupEnd":517.2000000476837,"domainLookupStart":517.2000000476837,"fetchStart":517.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":517.2000000476837,"responseEnd":921,"responseStart":921,"secureConnectionStart":517.2000000476837},{"duration":404.10000014305115,"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":517.3999998569489,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":517.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":921.5,"responseStart":0,"secureConnectionStart":0},{"duration":404,"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":517.5999999046326,"connectEnd":517.5999999046326,"connectStart":517.5999999046326,"domainLookupEnd":517.5999999046326,"domainLookupStart":517.5999999046326,"fetchStart":517.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":517.5999999046326,"responseEnd":921.5999999046326,"responseStart":921.5999999046326,"secureConnectionStart":517.5999999046326},{"duration":415.2999999523163,"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":523.5,"connectEnd":523.5,"connectStart":523.5,"domainLookupEnd":523.5,"domainLookupStart":523.5,"fetchStart":523.5,"redirectEnd":0,"redirectStart":0,"requestStart":523.5,"responseEnd":938.7999999523163,"responseStart":938.7999999523163,"secureConnectionStart":523.5},{"duration":430.10000014305115,"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":523.5999999046326,"connectEnd":523.5999999046326,"connectStart":523.5999999046326,"domainLookupEnd":523.5999999046326,"domainLookupStart":523.5999999046326,"fetchStart":523.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":523.5999999046326,"responseEnd":953.7000000476837,"responseStart":953.7000000476837,"secureConnectionStart":523.5999999046326},{"duration":332.2000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1153,"connectEnd":1153,"connectStart":1153,"domainLookupEnd":1153,"domainLookupStart":1153,"fetchStart":1153,"redirectEnd":0,"redirectStart":0,"requestStart":1153,"responseEnd":1485.2000000476837,"responseStart":1485.2000000476837,"secureConnectionStart":1153}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":300,"responseStart":510,"responseEnd":519,"domLoading":513,"domInteractive":1559,"domContentLoadedEventStart":1559,"domContentLoadedEventEnd":1605,"domComplete":1923,"loadEventStart":1923,"loadEventEnd":1924,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1524.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1525.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.start","time":1525.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1529.0999999046326},{"name":"activityTabFullyLoaded","time":1628.2999999523163}],"measures":[],"correlationId":"6e6f63240a5bb5","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":140,"dbReadsTimeInMs":25,"dbConnsTimeInMs":36,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}