-
Bug
-
-
Major
-
Resolution:
Fixed
-
None
-
-
-
A FROM subquery containing nested joins returns an error. However, if the same subquery is used as an outer query, we get the expected output.
Here are steps to reproduce the error:
MariaDB [test]> create table c1 (a int)engine=columnstore;
|
Query OK, 0 rows affected (0.381 sec)
|
|
MariaDB [test]> insert into c1 values (1), (2), (3);
|
Query OK, 3 rows affected (0.233 sec)
|
Records: 3 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> create table c2 (a int)engine=columnstore;
|
Query OK, 0 rows affected (0.338 sec)
|
|
MariaDB [test]> insert into c2 values (2);
|
Query OK, 1 row affected (0.109 sec)
|
|
MariaDB [test]> create table c3 (a int)engine=columnstore;
|
Query OK, 0 rows affected (0.327 sec)
|
|
MariaDB [test]> create table c4 (a int)engine=columnstore;
|
Query OK, 0 rows affected (0.336 sec)
|
|
MariaDB [test]> create table c5 (a int)engine=columnstore;
|
Query OK, 0 rows affected (0.361 sec)
|
|
MariaDB [test]> select * from
|
-> (
|
-> select c1.a as col1, c2.a as col2 from
|
-> c1 left join
|
-> (
|
-> (c2 left join c3 on c2.a=c3.a) left join
|
-> (c4 left join c5 on c4.a=c5.a)
|
-> on c2.a=c4.a
|
-> )
|
-> on c1.a=c2.a
|
-> ) h;
|
ERROR 1815 (HY000): Internal error: IDB-1000: 'c1' and 'c2, c3, c4, c5' are not joined.
|
Below is the same subquery as above, but used as an outer query:
MariaDB [test]> select c1.a as col1, c2.a as col2 from
|
-> c1 left join
|
-> (
|
-> (c2 left join c3 on c2.a=c3.a) left join
|
-> (c4 left join c5 on c4.a=c5.a)
|
-> on c2.a=c4.a
|
-> )
|
-> on c1.a=c2.a;
|
+------+------+
|
| col1 | col2 |
|
+------+------+
|
| 1 | NULL |
|
| 2 | 2 |
|
| 3 | NULL |
|
+------+------+
|
3 rows in set (0.021 sec)
|
Gagan Goel (Inactive)
made changes -
Field |
Original Value |
New Value |
Status
|
Open
[ 1
]
|
In Progress
[ 3
]
|
Gagan Goel (Inactive)
made changes -
Assignee
|
Gagan Goel
[ tntnatbry
]
|
Roman
[ drrtuy
]
|
Status
|
In Progress
[ 3
]
|
In Review
[ 10002
]
|
Gregory Dorman (Inactive)
made changes -
Affects Version/s
|
|
All
[ 25803
]
|
Affects Version/s
|
5.5.1
[ 25030
]
|
|
Affects Version/s
|
6.1.1
[ 25600
]
|
|
Roman
made changes -
Status
|
In Review
[ 10002
]
|
In Testing
[ 10301
]
|
Roman
made changes -
Assignee
|
Roman
[ drrtuy
]
|
Daniel Lee
[ dleeyh
]
|
Daniel Lee (Inactive)
made changes -
Resolution
|
|
Fixed
[ 1
]
|
Status
|
In Testing
[ 10301
]
|
Closed
[ 6
]
|
{"report":{"fcp":1081.8000001907349,"ttfb":261.30000019073486,"pageVisibility":"visible","entityId":98879,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b27992fe-75cc-4cb9-971a-b6d35471bc57","navigationType":0,"readyForUser":1173.1000001430511,"redirectCount":0,"resourceLoadedEnd":1188.7000000476837,"resourceLoadedStart":268.2000000476837,"resourceTiming":[{"duration":301.60000014305115,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":268.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":569.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":301.7000000476837,"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":268.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":570.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":310.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":268.7000000476837,"connectEnd":268.7000000476837,"connectStart":268.7000000476837,"domainLookupEnd":268.7000000476837,"domainLookupStart":268.7000000476837,"fetchStart":268.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":268.7000000476837,"responseEnd":579.6000001430511,"responseStart":579.6000001430511,"secureConnectionStart":268.7000000476837},{"duration":409.59999990463257,"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":268.90000009536743,"connectEnd":268.90000009536743,"connectStart":268.90000009536743,"domainLookupEnd":268.90000009536743,"domainLookupStart":268.90000009536743,"fetchStart":268.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":268.90000009536743,"responseEnd":678.5,"responseStart":678.5,"secureConnectionStart":268.90000009536743},{"duration":413.2000000476837,"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":269,"connectEnd":269,"connectStart":269,"domainLookupEnd":269,"domainLookupStart":269,"fetchStart":269,"redirectEnd":0,"redirectStart":0,"requestStart":269,"responseEnd":682.2000000476837,"responseStart":682.2000000476837,"secureConnectionStart":269},{"duration":413.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":269.30000019073486,"connectEnd":269.30000019073486,"connectStart":269.30000019073486,"domainLookupEnd":269.30000019073486,"domainLookupStart":269.30000019073486,"fetchStart":269.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":269.30000019073486,"responseEnd":682.6000001430511,"responseStart":682.6000001430511,"secureConnectionStart":269.30000019073486},{"duration":413.59999990463257,"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":269.40000009536743,"connectEnd":269.40000009536743,"connectStart":269.40000009536743,"domainLookupEnd":269.40000009536743,"domainLookupStart":269.40000009536743,"fetchStart":269.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":269.40000009536743,"responseEnd":683,"responseStart":683,"secureConnectionStart":269.40000009536743},{"duration":458.7999999523163,"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":269.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":269.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":728.5,"responseStart":0,"secureConnectionStart":0},{"duration":413.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":269.80000019073486,"connectEnd":269.80000019073486,"connectStart":269.80000019073486,"domainLookupEnd":269.80000019073486,"domainLookupStart":269.80000019073486,"fetchStart":269.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":269.80000019073486,"responseEnd":683.6000001430511,"responseStart":683.6000001430511,"secureConnectionStart":269.80000019073486},{"duration":458.7000000476837,"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":270,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":270,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":728.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":416.59999990463257,"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":270.10000014305115,"connectEnd":270.10000014305115,"connectStart":270.10000014305115,"domainLookupEnd":270.10000014305115,"domainLookupStart":270.10000014305115,"fetchStart":270.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":270.10000014305115,"responseEnd":686.7000000476837,"responseStart":686.7000000476837,"secureConnectionStart":270.10000014305115},{"duration":654.7999999523163,"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":276.30000019073486,"connectEnd":276.30000019073486,"connectStart":276.30000019073486,"domainLookupEnd":276.30000019073486,"domainLookupStart":276.30000019073486,"fetchStart":276.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":276.30000019073486,"responseEnd":931.1000001430511,"responseStart":931.1000001430511,"secureConnectionStart":276.30000019073486},{"duration":661.2999999523163,"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":276.40000009536743,"connectEnd":276.40000009536743,"connectStart":276.40000009536743,"domainLookupEnd":276.40000009536743,"domainLookupStart":276.40000009536743,"fetchStart":276.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":276.40000009536743,"responseEnd":937.7000000476837,"responseStart":937.7000000476837,"secureConnectionStart":276.40000009536743},{"duration":56.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":771.4000000953674,"connectEnd":771.4000000953674,"connectStart":771.4000000953674,"domainLookupEnd":771.4000000953674,"domainLookupStart":771.4000000953674,"fetchStart":771.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":771.4000000953674,"responseEnd":828,"responseStart":828,"secureConnectionStart":771.4000000953674},{"duration":157.59999990463257,"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":1031.1000001430511,"connectEnd":1031.1000001430511,"connectStart":1031.1000001430511,"domainLookupEnd":1031.1000001430511,"domainLookupStart":1031.1000001430511,"fetchStart":1031.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":1031.1000001430511,"responseEnd":1188.7000000476837,"responseStart":1188.7000000476837,"secureConnectionStart":1031.1000001430511},{"duration":306.7999999523163,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1073.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1073.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1380.6000001430511,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":35,"responseStart":261,"responseEnd":271,"domLoading":266,"domInteractive":1309,"domContentLoadedEventStart":1309,"domContentLoadedEventEnd":1375,"domComplete":1419,"loadEventStart":1419,"loadEventEnd":1420,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1269.6000001430511},{"name":"bigPipe.sidebar-id.end","time":1270.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1270.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1275.6000001430511},{"name":"activityTabFullyLoaded","time":1395.5}],"measures":[],"correlationId":"c0a5f7e31d058b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":144,"dbReadsTimeInMs":25,"dbConnsTimeInMs":35,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
For QA: Query to confirm the issue and verify the fix works is in the issue description.