[MDEV-10884] Wrong query result with condition pushdown into derived table with ORDER BY ... LIMIT Created: 2016-09-24 Updated: 2016-09-26 Resolved: 2016-09-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Test dataset:
Use the above query in a derived table, without condition_pushdown_for_derived:
Enabling condition_pushdown_for_derived:
and see rows with id=5 and so forth. It looks like TBL.a not in (1,2,3) was pushed through ORDER BY ... LIMIT, which changes the query result. |
| Comments |
| Comment by Igor Babaev [ 2016-09-26 ] | |||||||||||||||||||||
|
The condition should not have been pushed into SELECTs with ORDER BY ... LIMIT. Similarly they should not be pushed into SELECTs of a unit with global ORDER BY ... LIMIT.
| |||||||||||||||||||||
| Comment by Igor Babaev [ 2016-09-26 ] | |||||||||||||||||||||
|
The fix for this bug was pushed into the 10.2 tree. |