[MDEV-19778] Wrong Result on Left Outer Join with Subquery right on true and WHERE filter afterwards Created: 2019-06-17 Updated: 2019-07-29 Resolved: 2019-06-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.4.5, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.26, 5.5.65, 10.1.41, 10.3.17, 10.4.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | - | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | optimizer, wrong_result | ||
| Environment: |
MariaDB Docker (Bionic) on Ubuntu Linux 18.04 |
||
| Issue Links: |
|
||||||||
| Description |
|
Summary: The following query returns an entry ('1'), even if there is no matching columns.
I expect that an empty result set is returned because no query matches the given Condition. Postgres 11 doesn't return anything, which is correct. MySQL 8.0.16 is also affected, I'm not sure about other mariadb or mysql versions. |
| Comments |
| Comment by Alice Sherepa [ 2019-06-17 ] | |||||||||||||||||||||||||||
|
Thanks! I repeated on 5.5-10.4. Also the same on Mysql 5.7.26, but Mysql 5.6.40 retured the correct result
| |||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2019-06-20 ] | |||||||||||||||||||||||||||
|
This is a more generalized test for this bug:
The last row in the result set does not satisfy the WHERE condition t1.a=v1.d (3 != NULL). | |||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2019-06-20 ] | |||||||||||||||||||||||||||
|
This bug is a result of incompleteness of the fix for bug
from the above test case. | |||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2019-06-21 ] | |||||||||||||||||||||||||||
|
Ok to push | |||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2019-06-26 ] | |||||||||||||||||||||||||||
|
A fix for this bug was pushed into 5.5. |