[MDEV-26965] Left join to derived table on multiple clauses with aggregation returns missing/incorrect results Created: 2021-11-03 Updated: 2022-02-01 Resolved: 2022-01-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.6.4, 10.3, 10.4, 10.5, 10.6, 10.7 |
| Fix Version/s: | 10.3.33, 10.4.23, 10.5.14, 10.6.6, 10.7.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Luke Cousins | Assignee: | Alice Sherepa |
| Resolution: | Fixed | Votes: | 4 |
| Labels: | optimizer, regression | ||
| Environment: |
Ubuntu Focal |
||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
I couldn't work out how to reopen an issue, so sorry for making a new one. The problem in Using `SET optimizer_switch="split_materialized=off";` fixes the problem, so this is our temporary work-around. Thanks for your help. |
| Comments |
| Comment by Alice Sherepa [ 2021-11-03 ] | |||||||||||||
|
Could you please add the test case to demonstrate the problem, tests from | |||||||||||||
| Comment by Luke Cousins [ 2021-11-11 ] | |||||||||||||
|
Apologies for the delay. I will get a test case together for you. Our production query is very complicated, and I'm struggling to produce a simpler query that demonstrates the problem, but I'll make sure I get back to you soon with something suitable. | |||||||||||||
| Comment by Matthieu Lombard [ 2022-01-06 ] | |||||||||||||
|
I have the same problem in version 10.3.32. To reproduce with the joined dataset.sql, try to execute this request :
It give us : With JOIN clause in subquery : WRONG RESULT Without some clauses in subquery, (comment `AND a2.application_date IS NOT NULL` or `WHERE...` or `ORDER BY...`) : GOOD RESULT (In both case, subquery return same results, so final result should be the same too) Without indexes in applications table, we got good result too. Thanks for help ! | |||||||||||||
| Comment by Alice Sherepa [ 2022-01-31 ] | |||||||||||||
|
Matthieu Thanks! I repeated the bug, currently, it is fixed by the commit 97425f740faf83ac2d by Igor Bababev, | |||||||||||||
| Comment by Igor Babaev [ 2022-01-31 ] | |||||||||||||
|
Closed as a duplicate of | |||||||||||||
| Comment by Igor Babaev [ 2022-01-31 ] | |||||||||||||
|
The patch for | |||||||||||||
| Comment by Matthieu Lombard [ 2022-02-01 ] | |||||||||||||
|
Thanks! |