select * from t1 join t2 join t3 on t2.a=t3.a on t1.a=t2.a;
over tables t1,t2,t3
createtable t1 (a int);
insertinto t1 values (7), (2), (9);
createtable t2 (a int);
insertinto t2 values (5), (1), (7);
createtable t3 (a int);
insertinto t3 values (2), (7), (3);
cannot be parsed in MariaDB 10.4:
MariaDB [test]> select * from t1 join t2 join t3 on t2.a=t3.a on t1.a=t2.a;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'on t1.a=t2.a' at line 1
MySQL 8.0 handles this query properly:
mysql> select * from t1 join t2 join t3 on t2.a=t3.a on t1.a=t2.a;
+------+------+------+
| a | a | a |
+------+------+------+
| 7 | 7 | 7 |
+------+------+------+
This basic valid query also returns syntax error message:
select * from t1 join t2 leftjoin t3 on t2.a=t3.a on t1.a=t2.a;
Attachments
Issue Links
causes
MDEV-20330Combination of "," (comma), cross join and left join fails to parse (regression since 10.1.40)
Closed
MDEV-21894MariaDB 10.3 onward unable to parse syntax that works in earlier versions
The bug is reproducible in all versions starting from 5.5.
A has been prepared for 5.5 and it is supposed to be merged up to 10.3.
Another patch has been prepared for 10.4 because the grammar rules for 10.4 differ significantly from those in 5.5-10.3.
Igor Babaev (Inactive)
added a comment - The bug is reproducible in all versions starting from 5.5.
A has been prepared for 5.5 and it is supposed to be merged up to 10.3.
Another patch has been prepared for 10.4 because the grammar rules for 10.4 differ significantly from those in 5.5-10.3.
A fix for this bug was pushed into 5.5. I has to be merged upstream into 10.1-10.3 as it is.
10.4 requires a slightly different patch that has been already prepared.
Igor Babaev (Inactive)
added a comment - A fix for this bug was pushed into 5.5. I has to be merged upstream into 10.1-10.3 as it is.
10.4 requires a slightly different patch that has been already prepared.
People
Igor Babaev (Inactive)
Igor Babaev (Inactive)
Votes:
1Vote 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":3324.7000002861023,"ttfb":448,"pageVisibility":"visible","entityId":75924,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"ce2c562b-8b62-45d9-87c5-e81933129867","navigationType":0,"readyForUser":3514.800000190735,"redirectCount":0,"resourceLoadedEnd":2840.9000000953674,"resourceLoadedStart":459.6000003814697,"resourceTiming":[{"duration":358.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":459.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":459.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":818.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":503.2000002861023,"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":459.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":459.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":963.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":1264.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":460.1000003814697,"connectEnd":460.1000003814697,"connectStart":460.1000003814697,"domainLookupEnd":460.1000003814697,"domainLookupStart":460.1000003814697,"fetchStart":460.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":969.9000000953674,"responseEnd":1725,"responseStart":988.6000003814697,"secureConnectionStart":460.1000003814697},{"duration":2132.9000000953674,"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":460.30000019073486,"connectEnd":460.30000019073486,"connectStart":460.30000019073486,"domainLookupEnd":460.30000019073486,"domainLookupStart":460.30000019073486,"fetchStart":460.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":987.6000003814697,"responseEnd":2593.2000002861023,"responseStart":1006.3000001907349,"secureConnectionStart":460.30000019073486},{"duration":548,"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":460.40000009536743,"connectEnd":460.40000009536743,"connectStart":460.40000009536743,"domainLookupEnd":460.40000009536743,"domainLookupStart":460.40000009536743,"fetchStart":460.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":988.3000001907349,"responseEnd":1008.4000000953674,"responseStart":1007.6000003814697,"secureConnectionStart":460.40000009536743},{"duration":549.2999997138977,"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":460.6000003814697,"connectEnd":460.6000003814697,"connectStart":460.6000003814697,"domainLookupEnd":460.6000003814697,"domainLookupStart":460.6000003814697,"fetchStart":460.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":988.1000003814697,"responseEnd":1009.9000000953674,"responseStart":1008.5,"secureConnectionStart":460.6000003814697},{"duration":549.3000001907349,"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":460.80000019073486,"connectEnd":460.80000019073486,"connectStart":460.80000019073486,"domainLookupEnd":460.80000019073486,"domainLookupStart":460.80000019073486,"fetchStart":460.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":988.4000000953674,"responseEnd":1010.1000003814697,"responseStart":1009.2000002861023,"secureConnectionStart":460.80000019073486},{"duration":523.9000000953674,"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":460.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":460.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":984.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":550.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":461.1000003814697,"connectEnd":461.1000003814697,"connectStart":461.1000003814697,"domainLookupEnd":461.1000003814697,"domainLookupStart":461.1000003814697,"fetchStart":461.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":989.4000000953674,"responseEnd":1011.5,"responseStart":1010.5,"secureConnectionStart":461.1000003814697},{"duration":525.5,"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":461.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":461.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":986.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":551,"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":461.40000009536743,"connectEnd":461.40000009536743,"connectStart":461.40000009536743,"domainLookupEnd":461.40000009536743,"domainLookupStart":461.40000009536743,"fetchStart":461.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":989.5,"responseEnd":1012.4000000953674,"responseStart":1011.7000002861023,"secureConnectionStart":461.40000009536743},{"duration":2366,"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":472.7000002861023,"connectEnd":472.7000002861023,"connectStart":472.7000002861023,"domainLookupEnd":472.7000002861023,"domainLookupStart":472.7000002861023,"fetchStart":472.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1466.3000001907349,"responseEnd":2838.7000002861023,"responseStart":2788.300000190735,"secureConnectionStart":472.7000002861023},{"duration":2368.0999999046326,"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":472.80000019073486,"connectEnd":472.80000019073486,"connectStart":472.80000019073486,"domainLookupEnd":472.80000019073486,"domainLookupStart":472.80000019073486,"fetchStart":472.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":1821.4000000953674,"responseEnd":2840.9000000953674,"responseStart":2817.7000002861023,"secureConnectionStart":472.80000019073486},{"duration":539.1999998092651,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":2525.800000190735,"connectEnd":2525.800000190735,"connectStart":2525.800000190735,"domainLookupEnd":2525.800000190735,"domainLookupStart":2525.800000190735,"fetchStart":2525.800000190735,"redirectEnd":0,"redirectStart":0,"requestStart":3032.5,"responseEnd":3065,"responseStart":3064.2000002861023,"secureConnectionStart":2525.800000190735},{"duration":478.2999997138977,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":3256.1000003814697,"connectEnd":3256.1000003814697,"connectStart":3256.1000003814697,"domainLookupEnd":3256.1000003814697,"domainLookupStart":3256.1000003814697,"fetchStart":3256.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":3696.4000000953674,"responseEnd":3734.4000000953674,"responseStart":3733.300000190735,"secureConnectionStart":3256.1000003814697}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":284,"responseStart":448,"responseEnd":465,"domLoading":454,"domInteractive":3671,"domContentLoadedEventStart":3671,"domContentLoadedEventEnd":3753,"domComplete":4587,"loadEventStart":4587,"loadEventEnd":4588,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":3604.300000190735},{"name":"bigPipe.sidebar-id.end","time":3605.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":3605.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":3606.7000002861023},{"name":"activityTabFullyLoaded","time":3773.4000000953674}],"measures":[],"correlationId":"7254ca84923bf4","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The bug is reproducible in all versions starting from 5.5.
A has been prepared for 5.5 and it is supposed to be merged up to 10.3.
Another patch has been prepared for 10.4 because the grammar rules for 10.4 differ significantly from those in 5.5-10.3.