[MDEV-25969] Condition pushdown into derived table doesn't work if select list uses SP Created: 2021-06-20 Updated: 2021-10-11 Resolved: 2021-06-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.2.40, 10.3.31, 10.4.21, 10.5.12, 10.6.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
A simplified testcase without any customer data:
I get this both on 10.5.11 and 10.2.14:
add col2=321 into the WHERE clause and on 10.5.11 I get this:
while on 10.2.14 table t1 is still accessed through ref access. |
| Comments |
| Comment by Sergei Petrunia [ 2021-06-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2021-June/014657.html | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-06-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Review input from the Optimizer Call:
Decided against using this solution
A: I don't think C++ allows this. Here's an example attempt https://gist.github.com/spetrunia/39171079b4c0d680d63ae60f1ac274f1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2021-06-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The following patch applied to the current 10.2 fixes the problem:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2021-06-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sergey, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-06-25 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2021-June/014663.html . igor, please review. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-06-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Next variant, the patch against 10.2: http://lists.askmonty.org/pipermail/commits/2021-June/014667.html . igor, please review. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2021-06-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It is also in bb-10.2-mdev25969 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2021-06-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Ok to push into 10.2 after applying some minor changes in comments |