Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.0.30 , 10.1.23 , 10.2.5 , 5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL)
With optimizer_switch materialization=on, the following test case fails with wrong results in MariaDB (tested 10.0.30, 10.1.23, and 10.2.5). This works with MySQL 5.6 and 5.7, and also with MariaDB if you set materialization=off.
Here is sample output from the sql file (attached) when piped into MariaDB 10.2.5:
>mysql -uroot -pxxx -P3317 -e"select @@version\Gselect @@optimizer_switch\G"
*************************** 1. row ***************************
@@version: 10.2.5-MariaDB
*************************** 1. row ***************************
@@optimizer_switch: 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=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
C:\>mysql -uroot -pxxx -P3317 < test_case_obfuscated.sql
assignment_group
ebb4620037332000158bbfc8bcbe5d89
C:\>mysql -uroot -pxxx -P3317 -e"set @@global.optimizer_switch='materialization=off'"
C:\>mysql -uroot -pxxx -P3317 -e"select @@version\Gselect @@optimizer_switch\G"
*************************** 1. row ***************************
@@version: 10.2.5-MariaDB
*************************** 1. row ***************************
@@optimizer_switch: 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=off,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=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on
C:\>mysql -uroot -pxxx -P3317 < test_case_obfuscated.sql
assignment_group
ebb4620037332000158bbfc8bcbe5d89
ec70316637232000158bbfc8bcbe5d60
3120fd2637232000158bbfc8bcbe5d42
e08fad2637232000158bbfc8bcbe5d39
Elena Stepanova
made changes -
2017-05-18 21:32
Field
Original Value
New Value
Status
Open
[ 1
]
Confirmed
[ 10101
]
Elena Stepanova
made changes -
2017-05-18 21:34
Component/s
Optimizer
[ 10200
]
Fix Version/s
5.5
[ 15800
]
Fix Version/s
10.0
[ 16000
]
Fix Version/s
10.1
[ 16100
]
Fix Version/s
10.2
[ 14601
]
Assignee
Sergei Petrunia
[ psergey
]
Priority
Major
[ 3
]
Critical
[ 2
]
Elena Stepanova
made changes -
2017-05-18 21:35
Affects Version/s
5.5
[ 15800
]
Affects Version/s
10.0
[ 16000
]
Affects Version/s
10.1
[ 16100
]
Affects Version/s
10.2
[ 14601
]
Elena Stepanova
made changes -
2017-05-18 21:38
Summary
Wrong results with materialization=off (with subquery and joins)
Wrong results with materialization=on (with subquery and joins)
Igor Babaev (Inactive)
made changes -
2017-05-31 17:52
Assignee
Igor Babaev
[ igor
]
Sergei Petrunia
[ psergey
]
Status
In Progress
[ 3
]
In Review
[ 10002
]
Igor Babaev (Inactive)
made changes -
2017-06-07 21:27
Assignee
Sergei Petrunia
[ psergey
]
Igor Babaev
[ igor
]
Igor Babaev (Inactive)
made changes -
2017-06-07 21:28
Assignee
Igor Babaev
[ igor
]
Sergei Petrunia
[ psergey
]
Igor Babaev (Inactive)
made changes -
2017-06-07 21:29
Assignee
Sergei Petrunia
[ psergey
]
Igor Babaev
[ igor
]
Igor Babaev (Inactive)
made changes -
2017-06-07 21:30
Fix Version/s
5.5.57
[ 22539
]
Fix Version/s
10.2
[ 14601
]
Fix Version/s
5.5
[ 15800
]
Fix Version/s
10.0
[ 16000
]
Fix Version/s
10.1
[ 16100
]
Resolution
Fixed
[ 1
]
Status
Stalled
[ 10000
]
Closed
[ 6
]
Elena Stepanova
made changes -
2017-06-14 23:04
Fix Version/s
10.0.32
[ 22504
]
Fix Version/s
10.1.25
[ 22542
]
Fix Version/s
10.2.7
[ 22543
]
Sergei Golubchik
made changes -
2021-12-06 21:44
Workflow
MariaDB v3
[ 80837
]
MariaDB v4
[ 152172
]
{"report":{"fcp":1333.7999992370605,"ttfb":261.69999980926514,"pageVisibility":"visible","entityId":61419,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"bd752f73-2975-4707-9539-275120841c3a","navigationType":0,"readyForUser":1440.5,"redirectCount":0,"resourceLoadedEnd":1918.3999996185303,"resourceLoadedStart":267,"resourceTiming":[{"duration":570.3999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":267,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":267,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":837.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":570.5,"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":267.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":267.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":837.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":579.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":267.3999996185303,"connectEnd":267.3999996185303,"connectStart":267.3999996185303,"domainLookupEnd":267.3999996185303,"domainLookupStart":267.3999996185303,"fetchStart":267.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":267.3999996185303,"responseEnd":847.0999994277954,"responseStart":847.0999994277954,"secureConnectionStart":267.3999996185303},{"duration":614.0999994277954,"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":267.5,"connectEnd":267.5,"connectStart":267.5,"domainLookupEnd":267.5,"domainLookupStart":267.5,"fetchStart":267.5,"redirectEnd":0,"redirectStart":0,"requestStart":267.5,"responseEnd":881.5999994277954,"responseStart":881.5999994277954,"secureConnectionStart":267.5},{"duration":617.6000003814697,"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":267.79999923706055,"connectEnd":267.79999923706055,"connectStart":267.79999923706055,"domainLookupEnd":267.79999923706055,"domainLookupStart":267.79999923706055,"fetchStart":267.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":267.79999923706055,"responseEnd":885.3999996185303,"responseStart":885.3999996185303,"secureConnectionStart":267.79999923706055},{"duration":617.8999996185303,"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":268,"connectEnd":268,"connectStart":268,"domainLookupEnd":268,"domainLookupStart":268,"fetchStart":268,"redirectEnd":0,"redirectStart":0,"requestStart":268,"responseEnd":885.8999996185303,"responseStart":885.8999996185303,"secureConnectionStart":268},{"duration":618.3999996185303,"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":268.19999980926514,"connectEnd":268.19999980926514,"connectStart":268.19999980926514,"domainLookupEnd":268.19999980926514,"domainLookupStart":268.19999980926514,"fetchStart":268.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":268.19999980926514,"responseEnd":886.5999994277954,"responseStart":886.5999994277954,"secureConnectionStart":268.19999980926514},{"duration":726.3999996185303,"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":268.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":994.7999992370605,"responseStart":0,"secureConnectionStart":0},{"duration":618.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":268.5999994277954,"connectEnd":268.5999994277954,"connectStart":268.5999994277954,"domainLookupEnd":268.5999994277954,"domainLookupStart":268.5999994277954,"fetchStart":268.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":268.5999994277954,"responseEnd":887.2999992370605,"responseStart":887.2999992370605,"secureConnectionStart":268.5999994277954},{"duration":726.3000001907349,"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":268.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":995,"responseStart":0,"secureConnectionStart":0},{"duration":619,"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":268.8999996185303,"connectEnd":268.8999996185303,"connectStart":268.8999996185303,"domainLookupEnd":268.8999996185303,"domainLookupStart":268.8999996185303,"fetchStart":268.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":268.8999996185303,"responseEnd":887.8999996185303,"responseStart":887.8999996185303,"secureConnectionStart":268.8999996185303},{"duration":1466.6000003814697,"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":275.3999996185303,"connectEnd":275.3999996185303,"connectStart":275.3999996185303,"domainLookupEnd":275.3999996185303,"domainLookupStart":275.3999996185303,"fetchStart":275.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":275.3999996185303,"responseEnd":1742,"responseStart":1742,"secureConnectionStart":275.3999996185303},{"duration":1631.3999996185303,"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":287,"connectEnd":287,"connectStart":287,"domainLookupEnd":287,"domainLookupStart":287,"fetchStart":287,"redirectEnd":0,"redirectStart":0,"requestStart":287,"responseEnd":1918.3999996185303,"responseStart":1918.3999996185303,"secureConnectionStart":287},{"duration":770,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1007.0999994277954,"connectEnd":1007.0999994277954,"connectStart":1007.0999994277954,"domainLookupEnd":1007.0999994277954,"domainLookupStart":1007.0999994277954,"fetchStart":1007.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":1007.0999994277954,"responseEnd":1777.0999994277954,"responseStart":1777.0999994277954,"secureConnectionStart":1007.0999994277954}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":32,"responseStart":261,"responseEnd":286,"domLoading":265,"domInteractive":1952,"domContentLoadedEventStart":1952,"domContentLoadedEventEnd":2002,"domComplete":2766,"loadEventStart":2767,"loadEventEnd":2767,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1922.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1923.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1923.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1928.6999998092651},{"name":"activityTabFullyLoaded","time":2022.1999998092651}],"measures":[],"correlationId":"218a5d49408af1","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":163,"dbReadsTimeInMs":25,"dbConnsTimeInMs":36,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}