[MDEV-11102] Wrong result (extra rows) on LEFT JOIN with a view and IS NULL in WHERE, condition_pushdown_for_derived=on Created: 2016-10-21 Updated: 2016-11-17 Resolved: 2016-11-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Views |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression-10.2 | ||
| Sprint: | 10.2.4-2 |
| Description |
|
|
| Comments |
| Comment by Oleksandr Byelkin [ 2016-11-16 ] |
|
The problem is that condition "b IS NULL" was pushed into the view. So it checked field not after LEFT JOIN where it should filter only mismatched in LEFT JOIN records but instead it filtered all records from the view (they are all not null). IMHO condition pushdown should be prohibited in LEFT table of LEFT JOIN (as well as RIGHT part of RIGHT JOIN, but we have it the same in your implementation). |
| Comment by Igor Babaev [ 2016-11-17 ] |
|
Two patches were pushed into the 10.2 tree to resolve this problem. The first patch contained an incorrect fix, while the other one finally fixed the bug. |