ycp, looks good to me.
A cosmetic comment is that I would write "= false" instead of "= 0" which is what we used to write in the old code.
Sergei Petrunia
added a comment - ycp , looks good to me.
A cosmetic comment is that I would write "= false" instead of "= 0" which is what we used to write in the old code.
Item_exists_subselect::fix_length_and_dec() sets explicit_limit to 1.
In the exists2in transformation it resets select_limit to NULL. For
consistency we should reset explicity_limit too.
This fixes a bug where spider table returns wrong results for queries
that gets through exists2in transformation when semijoin is off.
Yuchen Pei
added a comment - - edited Hi psergei , ptal this one-liner thanks:
upstream/bb-10.5-mdev-30408 upstream/bb-10.5-ycp 3e93edb6758cd93ef99319173946a6ef7369c741
MDEV-30408 Reset explicit_limit in exists2in
Item_exists_subselect::fix_length_and_dec() sets explicit_limit to 1.
In the exists2in transformation it resets select_limit to NULL. For
consistency we should reset explicity_limit too.
This fixes a bug where spider table returns wrong results for queries
that gets through exists2in transformation when semijoin is off.
Somehow with the semijoin=off optimizer switch, it uses the group by
handler (gbh) for the EXISTS subquery. Because such subqueries set
explicit_limit to true (see
Item_exists_subselect::fix_length_and_dec()), the gbh uses the default
limit value 0, which causes the subquery to return empty results.
Either we make gbh use the correct limit 1 in this case, or ban gbh
from being used. The latter requires checking why the optimizer switch
causes gbh to be used for the subquery.
Yuchen Pei
added a comment - Somehow with the semijoin=off optimizer switch, it uses the group by
handler (gbh) for the EXISTS subquery. Because such subqueries set
explicit_limit to true (see
Item_exists_subselect::fix_length_and_dec()), the gbh uses the default
limit value 0, which causes the subquery to return empty results.
Either we make gbh use the correct limit 1 in this case, or ban gbh
from being used. The latter requires checking why the optimizer switch
causes gbh to be used for the subquery.
People
Yuchen Pei
Michael Widenius
Votes:
0Vote for this issue
Watchers:
5Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1245.1999998092651,"ttfb":268.2999997138977,"pageVisibility":"visible","entityId":118257,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"bc4e0aca-6f3b-4349-8aa0-e6e6480e4590","navigationType":0,"readyForUser":1326.3999996185303,"redirectCount":0,"resourceLoadedEnd":1373.1999998092651,"resourceLoadedStart":274.69999980926514,"resourceTiming":[{"duration":192.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":274.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":274.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":467.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":217.40000009536743,"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":274.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":274.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":492.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":425.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":275.09999990463257,"connectEnd":275.09999990463257,"connectStart":275.09999990463257,"domainLookupEnd":275.09999990463257,"domainLookupStart":275.09999990463257,"fetchStart":275.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":275.09999990463257,"responseEnd":701,"responseStart":701,"secureConnectionStart":275.09999990463257},{"duration":591.2000002861023,"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":275.2999997138977,"connectEnd":275.2999997138977,"connectStart":275.2999997138977,"domainLookupEnd":275.2999997138977,"domainLookupStart":275.2999997138977,"fetchStart":275.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":275.2999997138977,"responseEnd":866.5,"responseStart":866.5,"secureConnectionStart":275.2999997138977},{"duration":595,"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":275.5,"connectEnd":275.5,"connectStart":275.5,"domainLookupEnd":275.5,"domainLookupStart":275.5,"fetchStart":275.5,"redirectEnd":0,"redirectStart":0,"requestStart":275.5,"responseEnd":870.5,"responseStart":870.5,"secureConnectionStart":275.5},{"duration":595.7000002861023,"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":275.7999997138977,"connectEnd":275.7999997138977,"connectStart":275.7999997138977,"domainLookupEnd":275.7999997138977,"domainLookupStart":275.7999997138977,"fetchStart":275.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":275.7999997138977,"responseEnd":871.5,"responseStart":871.5,"secureConnectionStart":275.7999997138977},{"duration":596.5,"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":275.8999996185303,"connectEnd":275.8999996185303,"connectStart":275.8999996185303,"domainLookupEnd":275.8999996185303,"domainLookupStart":275.8999996185303,"fetchStart":275.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":275.8999996185303,"responseEnd":872.3999996185303,"responseStart":872.3999996185303,"secureConnectionStart":275.8999996185303},{"duration":614,"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":276.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":890.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":597.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":276.19999980926514,"connectEnd":276.19999980926514,"connectStart":276.19999980926514,"domainLookupEnd":276.19999980926514,"domainLookupStart":276.19999980926514,"fetchStart":276.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":276.19999980926514,"responseEnd":873.2999997138977,"responseStart":873.2999997138977,"secureConnectionStart":276.19999980926514},{"duration":613.9000000953674,"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":276.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":890.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":597.2999997138977,"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":276.59999990463257,"connectEnd":276.59999990463257,"connectStart":276.59999990463257,"domainLookupEnd":276.59999990463257,"domainLookupStart":276.59999990463257,"fetchStart":276.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":276.59999990463257,"responseEnd":873.8999996185303,"responseStart":873.8999996185303,"secureConnectionStart":276.59999990463257},{"duration":940.4000000953674,"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":285.2999997138977,"connectEnd":285.2999997138977,"connectStart":285.2999997138977,"domainLookupEnd":285.2999997138977,"domainLookupStart":285.2999997138977,"fetchStart":285.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":285.2999997138977,"responseEnd":1225.6999998092651,"responseStart":1225.6999998092651,"secureConnectionStart":285.2999997138977},{"duration":976.3000001907349,"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":285.8999996185303,"connectEnd":285.8999996185303,"connectStart":285.8999996185303,"domainLookupEnd":285.8999996185303,"domainLookupStart":285.8999996185303,"fetchStart":285.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":285.8999996185303,"responseEnd":1262.1999998092651,"responseStart":1262.1999998092651,"secureConnectionStart":285.8999996185303},{"duration":319.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":906.7999997138977,"connectEnd":906.7999997138977,"connectStart":906.7999997138977,"domainLookupEnd":906.7999997138977,"domainLookupStart":906.7999997138977,"fetchStart":906.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":906.7999997138977,"responseEnd":1226.1999998092651,"responseStart":1226.0999999046326,"secureConnectionStart":906.7999997138977},{"duration":211.59999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1226.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1226.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1437.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":119.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":1254,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1254,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1373.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":24.199999809265137,"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&whisper-enabled=true","startTime":1255,"connectEnd":1255,"connectStart":1255,"domainLookupEnd":1255,"domainLookupStart":1255,"fetchStart":1255,"redirectEnd":0,"redirectStart":0,"requestStart":1255,"responseEnd":1279.1999998092651,"responseStart":1279.1999998092651,"secureConnectionStart":1255},{"duration":31.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/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&whisper-enabled=true","startTime":1255.5999999046326,"connectEnd":1255.5999999046326,"connectStart":1255.5999999046326,"domainLookupEnd":1255.5999999046326,"domainLookupStart":1255.5999999046326,"fetchStart":1255.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1255.5999999046326,"responseEnd":1287.5,"responseStart":1287.5,"secureConnectionStart":1255.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":102,"responseStart":268,"responseEnd":285,"domLoading":272,"domInteractive":1522,"domContentLoadedEventStart":1522,"domContentLoadedEventEnd":1597,"domComplete":1752,"loadEventStart":1752,"loadEventEnd":1753,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1471.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1472.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1472.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1474.7999997138977},{"name":"activityTabFullyLoaded","time":1617.3999996185303}],"measures":[],"correlationId":"1ff9242799006e","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":103,"dbReadsTimeInMs":12,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thanks for the review - updated and pushed 03a350378ad627d509a31a788896067b02f80e53 to 10.5