[MDEV-16064] Wrong result set from query with in subquery that uses window function Created: 2018-04-30 Updated: 2023-11-28 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - Window functions |
| Affects Version/s: | 10.2.14, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Igor Babaev | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | 11.0-sel | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
The following test case demonstrates the problem:
The output for the above query is:
This not correct as we have:
|
| Comments |
| Comment by Igor Babaev [ 2018-05-03 ] | |||||||||||||||||||||||
|
mysql-8.0.11 cannot handle this query:
| |||||||||||||||||||||||
| Comment by Igor Babaev [ 2018-05-03 ] | |||||||||||||||||||||||
|
EXPLAIN EXTENDED for this query shows that in-to-exists transformation is applied to the
The transformation is applied because the left part of the IN predicate is of the INTEGER type while the right part is of the DECIMAL part. | |||||||||||||||||||||||
| Comment by Igor Babaev [ 2018-05-03 ] | |||||||||||||||||||||||
|
Before using in-to-exists transformation here we have to wrap the subquery into a derived table. |