[MDEV-24343] Spider Left join failed Unknown column 't0.ID' in 'on clause' Created: 2020-12-03 Updated: 2022-06-28 Resolved: 2022-06-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Spider |
| Affects Version/s: | 10.5.8, 10.4, 10.6 |
| Fix Version/s: | 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | VAROQUI Stephane | Assignee: | Nayuta Yanagisawa (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | not-10.2, not-10.3 | ||
| Environment: |
Debian Buster x86 |
||
| Attachments: |
|
| Description |
|
Hi using spider as federated tables each table on same backend
Depending on the pos of LEFT join in FROM clause it failed or not . |
| Comments |
| Comment by Richard DEMONGEOT [ 2021-07-22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Same issue after an upgrade to MariaDB 10.5.11 . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Richard DEMONGEOT [ 2021-07-22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It seems that the engine deals with LEFT JOIN before the "JOIN".
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-08-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I confirmed that the bug is reproducible on 10.5 HEAD. The query executed on the data node is the following:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-08-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think this is due to the precedence of the operators. So, possible solution would be use 'JOIN' instead of the comma, or add parentheses like (t0, t1).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-08-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The bug is reproducible on 10.4 and 10.6, but not on 10.2. 10.3 HEAD. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-10-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MTR test case:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-10-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-10-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I tried git-bisect but it didn't work well between 10.4.6 and 10.4.7 (it required code modification to pass compilation and the test failed because of different reasons). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-10-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
mariadb-10.4.6 does not push down the join query. So, it is likely that this bug has been latent since when this kind (what kind?) of JOINs were to pushed down. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-10-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The following patch fixes the bug but this must affect other queries. So, I need to dig the problem further.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-10-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It doesn't seem to affect the other queries as much as I had initially expected. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2021-10-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
holyfoot Please review https://github.com/MariaDB/server/commit/33a058593f5c76f0a30c79ad7f1d7f7be83f18ea | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-05-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
holyfoot The fix has been proposed months ago. Please review. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2022-06-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
ok to push. |