-
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
|
Elena Stepanova
made changes -
Field |
Original Value |
New Value |
Link
|
|
This issue relates to TODO-60
[ TODO-60
]
|
Oleksandr Byelkin
made changes -
Status
|
Open
[ 1
]
|
In Progress
[ 3
]
|
Oleksandr Byelkin
made changes -
Status
|
In Progress
[ 3
]
|
Stalled
[ 10000
]
|
Igor Babaev (Inactive)
made changes -
Assignee
|
Oleksandr Byelkin
[ sanja
]
|
Sergei Petrunia
[ psergey
]
|
Sergei Petrunia
made changes -
Status
|
Stalled
[ 10000
]
|
In Progress
[ 3
]
|
Sergei Petrunia
made changes -
Status
|
In Progress
[ 3
]
|
Stalled
[ 10000
]
|
Sergei Petrunia
made changes -
Status
|
Stalled
[ 10000
]
|
In Progress
[ 3
]
|
Sergei Petrunia
made changes -
Status
|
In Progress
[ 3
]
|
Stalled
[ 10000
]
|
Sergei Petrunia
made changes -
Status
|
Stalled
[ 10000
]
|
In Progress
[ 3
]
|
Sergei Petrunia
made changes -
Fix Version/s
|
5.3.13
[ 12602
]
|
|
Resolution
|
|
Fixed
[ 1
]
|
Status
|
In Progress
[ 3
]
|
Closed
[ 6
]
|
Sergei Golubchik
made changes -
Workflow
|
defaullt
[ 28324
]
|
MariaDB v2
[ 44184
]
|
Sergei Golubchik
made changes -
Workflow
|
MariaDB v3
[ 64258
]
|
MariaDB v4
[ 146898
]
|
{"report":{"fcp":1137.3999999761581,"ttfb":407.7000000476837,"pageVisibility":"visible","entityId":25024,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"bc5bccc6-8b2a-441a-a70f-46d3c0e893d1","navigationType":0,"readyForUser":1245.6000000238419,"redirectCount":0,"resourceLoadedEnd":1194.5,"resourceLoadedStart":413.2999999523163,"resourceTiming":[{"duration":73.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":413.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":413.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":486.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":73.70000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":413.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":413.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":487.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":125.69999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":413.7000000476837,"connectEnd":413.7000000476837,"connectStart":413.7000000476837,"domainLookupEnd":413.7000000476837,"domainLookupStart":413.7000000476837,"fetchStart":413.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":413.7000000476837,"responseEnd":539.3999999761581,"responseStart":539.3999999761581,"secureConnectionStart":413.7000000476837},{"duration":329.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":414,"connectEnd":414,"connectStart":414,"domainLookupEnd":414,"domainLookupStart":414,"fetchStart":414,"redirectEnd":0,"redirectStart":0,"requestStart":414,"responseEnd":743.1000000238419,"responseStart":743.1000000238419,"secureConnectionStart":414},{"duration":333.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":414.10000002384186,"connectEnd":414.10000002384186,"connectStart":414.10000002384186,"domainLookupEnd":414.10000002384186,"domainLookupStart":414.10000002384186,"fetchStart":414.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":414.10000002384186,"responseEnd":747.2000000476837,"responseStart":747.2000000476837,"secureConnectionStart":414.10000002384186},{"duration":333.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":414.39999997615814,"connectEnd":414.39999997615814,"connectStart":414.39999997615814,"domainLookupEnd":414.39999997615814,"domainLookupStart":414.39999997615814,"fetchStart":414.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":414.39999997615814,"responseEnd":748.2999999523163,"responseStart":748.2999999523163,"secureConnectionStart":414.39999997615814},{"duration":334.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":414.7000000476837,"connectEnd":414.7000000476837,"connectStart":414.7000000476837,"domainLookupEnd":414.7000000476837,"domainLookupStart":414.7000000476837,"fetchStart":414.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":414.7000000476837,"responseEnd":749.2000000476837,"responseStart":749.2000000476837,"secureConnectionStart":414.7000000476837},{"duration":336.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":414.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":414.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":751.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":335.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":415,"connectEnd":415,"connectStart":415,"domainLookupEnd":415,"domainLookupStart":415,"fetchStart":415,"redirectEnd":0,"redirectStart":0,"requestStart":415,"responseEnd":750.8999999761581,"responseStart":750.7999999523163,"secureConnectionStart":415},{"duration":337.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":415.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":415.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":752.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":336.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":415.5,"connectEnd":415.5,"connectStart":415.5,"domainLookupEnd":415.5,"domainLookupStart":415.5,"fetchStart":415.5,"redirectEnd":0,"redirectStart":0,"requestStart":415.5,"responseEnd":752.2000000476837,"responseStart":752.2000000476837,"secureConnectionStart":415.5},{"duration":754.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":429,"connectEnd":429,"connectStart":429,"domainLookupEnd":429,"domainLookupStart":429,"fetchStart":429,"redirectEnd":0,"redirectStart":0,"requestStart":429,"responseEnd":1183.2999999523163,"responseStart":1183.2999999523163,"secureConnectionStart":429},{"duration":751.3999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":443.10000002384186,"connectEnd":443.10000002384186,"connectStart":443.10000002384186,"domainLookupEnd":443.10000002384186,"domainLookupStart":443.10000002384186,"fetchStart":443.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":443.10000002384186,"responseEnd":1194.5,"responseStart":1194.5,"secureConnectionStart":443.10000002384186},{"duration":485.8000000715256,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":696.3999999761581,"connectEnd":696.3999999761581,"connectStart":696.3999999761581,"domainLookupEnd":696.3999999761581,"domainLookupStart":696.3999999761581,"fetchStart":696.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":696.3999999761581,"responseEnd":1182.2000000476837,"responseStart":1182.2000000476837,"secureConnectionStart":696.3999999761581},{"duration":291.2000000476837,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1122,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1122,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1413.2000000476837,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":208,"responseStart":407,"responseEnd":445,"domLoading":411,"domInteractive":1468,"domContentLoadedEventStart":1468,"domContentLoadedEventEnd":1521,"domComplete":2188,"loadEventStart":2188,"loadEventEnd":2189,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1430.2999999523163},{"name":"bigPipe.sidebar-id.end","time":1431.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1431.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1435},{"name":"activityTabFullyLoaded","time":1538.7999999523163}],"measures":[],"correlationId":"f7fad5c8f89405","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":128,"dbReadsTimeInMs":22,"dbConnsTimeInMs":32,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}