-
Bug
-
-
Major
-
Resolution:
Fixed
-
10.0.3, 5.5.32, 5.1.67, 5.2.14, 5.3.12
-
-
None
-
With the test case below, the first query produces 3 rows, which I believe to be the correct result:
SELECT * FROM iso_code LEFT JOIN ( city LEFT JOIN country ON city.country_code = country.code ) ON iso_code.alpha3 = country.code ;
|
alpha3 country_code name code name
|
USA USA Austin USA United States
|
USA USA Boston USA United States
|
CAN NULL NULL NULL NULL
|
But the second query, which only differs from the previous one by the select list, produces two rows:
SELECT iso_code.alpha3 FROM iso_code LEFT JOIN ( city LEFT JOIN country ON city.country_code = country.code ) ON iso_code.alpha3 = country.code ;
|
alpha3
|
USA
|
CAN
|
Reproducible on MariaDB 5.1 from the beginning of time (tried 5.1.42), 5.2, 5.3, 5.5, 10.0.
Not reproducible on MySQL 5.1, 5.5, 5.6.
--source include/have_innodb.inc
|
|
CREATE TABLE iso_code (alpha3 VARCHAR(3)) ENGINE=InnoDB;
|
INSERT INTO iso_code VALUES ('USA'),('CAN');
|
|
CREATE TABLE city ( country_code VARCHAR(3), name VARCHAR(64)) ENGINE=InnoDB;
|
INSERT INTO city VALUES ('USA','Austin'),('USA','Boston');
|
|
CREATE TABLE country ( code VARCHAR(3), name VARCHAR(64), PRIMARY KEY (code), UNIQUE KEY (name)) ENGINE=InnoDB;
|
INSERT INTO country VALUES ('CAN','Canada'),('USA','United States');
|
|
SELECT * FROM iso_code LEFT JOIN ( city LEFT JOIN country ON city.country_code = country.code ) ON iso_code.alpha3 = country.code ;
|
SELECT iso_code.alpha3 FROM iso_code LEFT JOIN ( city LEFT JOIN country ON city.country_code = country.code ) ON iso_code.alpha3 = country.code ;
|
|
|
DROP TABLE iso_code, city, country;
|
EXPLAIN:
EXPLAIN EXTENDED
|
SELECT iso_code.alpha3 FROM iso_code LEFT JOIN ( city LEFT JOIN country ON city.country_code = country.code ) ON iso_code.alpha3 = country.code ;
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
1 SIMPLE iso_code ALL NULL NULL NULL NULL 2 100.00
|
Warnings:
|
Note 1003 select `test`.`iso_code`.`alpha3` AS `alpha3` from `test`.`iso_code` where 1
|
{"report":{"fcp":925.9000000059605,"ttfb":216.5,"pageVisibility":"visible","entityId":25024,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"1448896f-b8aa-48dd-bfb9-25f89c0a57a4","navigationType":0,"readyForUser":1007.7000000029802,"redirectCount":0,"resourceLoadedEnd":1275.5999999940395,"resourceLoadedStart":221.40000000596046,"resourceTiming":[{"duration":234.69999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":221.40000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":221.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":456.09999999403954,"responseStart":0,"secureConnectionStart":0},{"duration":234.70000000298023,"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":221.70000000298023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":221.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":456.40000000596046,"responseStart":0,"secureConnectionStart":0},{"duration":243.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":221.90000000596046,"connectEnd":221.90000000596046,"connectStart":221.90000000596046,"domainLookupEnd":221.90000000596046,"domainLookupStart":221.90000000596046,"fetchStart":221.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":221.90000000596046,"responseEnd":465.40000000596046,"responseStart":465.40000000596046,"secureConnectionStart":221.90000000596046},{"duration":278.29999999701977,"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":222,"connectEnd":222,"connectStart":222,"domainLookupEnd":222,"domainLookupStart":222,"fetchStart":222,"redirectEnd":0,"redirectStart":0,"requestStart":222,"responseEnd":500.29999999701977,"responseStart":500.29999999701977,"secureConnectionStart":222},{"duration":282.09999999403954,"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":222.20000000298023,"connectEnd":222.20000000298023,"connectStart":222.20000000298023,"domainLookupEnd":222.20000000298023,"domainLookupStart":222.20000000298023,"fetchStart":222.20000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":222.20000000298023,"responseEnd":504.29999999701977,"responseStart":504.29999999701977,"secureConnectionStart":222.20000000298023},{"duration":282.20000000298023,"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":222.5,"connectEnd":222.5,"connectStart":222.5,"domainLookupEnd":222.5,"domainLookupStart":222.5,"fetchStart":222.5,"redirectEnd":0,"redirectStart":0,"requestStart":222.5,"responseEnd":504.70000000298023,"responseStart":504.70000000298023,"secureConnectionStart":222.5},{"duration":282.3999999910593,"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":222.70000000298023,"connectEnd":222.70000000298023,"connectStart":222.70000000298023,"domainLookupEnd":222.70000000298023,"domainLookupStart":222.70000000298023,"fetchStart":222.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":222.70000000298023,"responseEnd":505.09999999403954,"responseStart":505.09999999403954,"secureConnectionStart":222.70000000298023},{"duration":384.1000000089407,"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":222.79999999701977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":222.79999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":606.9000000059605,"responseStart":0,"secureConnectionStart":0},{"duration":282.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":222.90000000596046,"connectEnd":222.90000000596046,"connectStart":222.90000000596046,"domainLookupEnd":222.90000000596046,"domainLookupStart":222.90000000596046,"fetchStart":222.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":222.90000000596046,"responseEnd":505.59999999403954,"responseStart":505.59999999403954,"secureConnectionStart":222.90000000596046},{"duration":384,"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":223.09999999403954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":223.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":607.0999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":282.8999999910593,"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":223.20000000298023,"connectEnd":223.20000000298023,"connectStart":223.20000000298023,"domainLookupEnd":223.20000000298023,"domainLookupStart":223.20000000298023,"fetchStart":223.20000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":223.20000000298023,"responseEnd":506.09999999403954,"responseStart":506.09999999403954,"secureConnectionStart":223.20000000298023},{"duration":551.8000000119209,"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":228.59999999403954,"connectEnd":228.59999999403954,"connectStart":228.59999999403954,"domainLookupEnd":228.59999999403954,"domainLookupStart":228.59999999403954,"fetchStart":228.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":228.59999999403954,"responseEnd":780.4000000059605,"responseStart":780.4000000059605,"secureConnectionStart":228.59999999403954},{"duration":1030.0999999940395,"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":229,"connectEnd":229,"connectStart":229,"domainLookupEnd":229,"domainLookupStart":229,"fetchStart":229,"redirectEnd":0,"redirectStart":0,"requestStart":229,"responseEnd":1259.0999999940395,"responseStart":1259.0999999940395,"secureConnectionStart":229},{"duration":179.59999999403954,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":618,"connectEnd":618,"connectStart":618,"domainLookupEnd":618,"domainLookupStart":618,"fetchStart":618,"redirectEnd":0,"redirectStart":0,"requestStart":618,"responseEnd":797.5999999940395,"responseStart":797.5999999940395,"secureConnectionStart":618},{"duration":394.29999999701977,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/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","startTime":881.2999999970198,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":881.2999999970198,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1275.5999999940395,"responseStart":0,"secureConnectionStart":0},{"duration":393.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/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":882.2000000029802,"connectEnd":882.2000000029802,"connectStart":882.2000000029802,"domainLookupEnd":882.2000000029802,"domainLookupStart":882.2000000029802,"fetchStart":882.2000000029802,"redirectEnd":0,"redirectStart":0,"requestStart":882.2000000029802,"responseEnd":1275.2999999970198,"responseStart":1275.2999999970198,"secureConnectionStart":882.2000000029802},{"duration":412.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/53a43b6764f587426c7bb9a150184c00-CDN/lu2bv2/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","startTime":882.5999999940395,"connectEnd":882.5999999940395,"connectStart":882.5999999940395,"domainLookupEnd":882.5999999940395,"domainLookupStart":882.5999999940395,"fetchStart":882.5999999940395,"redirectEnd":0,"redirectStart":0,"requestStart":882.5999999940395,"responseEnd":1295.4000000059605,"responseStart":1295.4000000059605,"secureConnectionStart":882.5999999940395}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":69,"responseStart":216,"responseEnd":228,"domLoading":219,"domInteractive":1282,"domContentLoadedEventStart":1282,"domContentLoadedEventEnd":1321,"domComplete":2526,"loadEventStart":2526,"loadEventEnd":2528,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1260.7999999970198},{"name":"bigPipe.sidebar-id.end","time":1261.7999999970198},{"name":"bigPipe.activity-panel-pipe-id.start","time":1261.9000000059605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1264.2999999970198},{"name":"activityTabFullyLoaded","time":1328.4000000059605}],"measures":[],"correlationId":"a6732270cf5074","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":86,"dbReadsTimeInMs":9,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}