[MDEV-4152] Exists2In: Wrong result (missing rows) with exists_to_in=on, inner joins Created: 2013-02-08 Updated: 2013-02-13 Resolved: 2013-02-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 10.0.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Description |
|
The following test case
Produces 2 rows if exists_to_in=off and an empty result set if exists_to_in=on. Two rows is the correct result.
EXPLAIN with exists_to_in=on, otherwise default optimizer_switch:
|
| Comments |
| Comment by Oleksandr Byelkin [ 2013-02-08 ] |
|
transformed query (even if semi-join replaced with join return correct result, so transformation is correct: |
| Comment by Oleksandr Byelkin [ 2013-02-12 ] |
|
the problem is that weedout table was not cleaned or its cleanup (start) made on wrong join_tab. |
| Comment by Oleksandr Byelkin [ 2013-02-12 ] |
|
As was explained by Sergey Petrunia plan is incorrect because outer table t1 goes after weedout table end. |
| Comment by Oleksandr Byelkin [ 2013-02-13 ] |
|
The problem is that subquery does not report t1 as used table (used_tables()). |