[MDEV-3914] Wrong result (NULLs instead of real values) with INNER and RIGHT JOIN in a FROM subquery, derived_merge=on Created: 2012-12-04 Updated: 2012-12-06 Resolved: 2012-12-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.0, 5.5.28, 5.3.10 |
| Fix Version/s: | 10.0.1, 5.5.29, 5.3.12 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
The following test case
returns NULLs:
If the subquery is executed separately, it returns not null values, which is the correct result:
The problem was either introduced or made visible with the revision http://bazaar.launchpad.net/~maria-captains/maria/5.3/revision/3574:
Reproducible on current maria/5.3, maria/5.5, maria/10.0. Minimal optimizer_switch: derived_merge=on.
EXPLAIN with the default optimizer_switch (also wrong result):
EXPLAIN with the minimal optimizer_switch (also wrong result):
|
| Comments |
| Comment by Elena Stepanova [ 2012-12-04 ] |
|
Assigned to Sanja because it relates to his commit, please reassign if necessary. |
| Comment by Oleksandr Byelkin [ 2012-12-04 ] |
|
The problem is that TABLE_LIST::get_real_join_table incorrectly finds first table - t1 in "( t1 INNER JOIN t2 ) RIGHT JOIN t3". Correct first table is t3. |
| Comment by Oleksandr Byelkin [ 2012-12-05 ] |
|
Fix committed for review. |
| Comment by Oleksandr Byelkin [ 2012-12-05 ] |
|
Pushed to 5.3 |