[MDEV-5369] Wrong result (0 instead of NULL) on 2nd execution of PS with LEFT JOIN, TEMPTABLE view Created: 2013-12-01 Updated: 2014-01-29 Resolved: 2014-01-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.34, 10.0.6 |
| Fix Version/s: | 5.5.35, 10.0.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||
| Description |
|
The problem appeared on the 5.5 tree with the following revision:
However it doesn't seem to be reproducible on 5.3 tree after the merged revision. Test case:
Actual result:
Expected result:
|
| Comments |
| Comment by Oleksandr Byelkin [ 2013-12-11 ] |
|
0 caused by Item_sum_sum::add call on second execution where argument is not NULL. |
| Comment by Oleksandr Byelkin [ 2013-12-11 ] |
|
difference between 5.5. and 5.3 is that in sub_select() join_tab->last_inner set for 5.5 |
| Comment by Oleksandr Byelkin [ 2013-12-11 ] |
|
Above happened because outer_join of the temporary table become JOIN_TYPE_LEFT |
| Comment by Oleksandr Byelkin [ 2013-12-11 ] |
|
it is different optimisations on different executions: |
| Comment by Oleksandr Byelkin [ 2014-01-22 ] |
|
table->pos_in_table_list->outer_join in join_read_const_table() fot t2 differ on second execution |
| Comment by Oleksandr Byelkin [ 2014-01-22 ] |
|
The problem is in JOIN_TYPE_OUTER |
| Comment by Oleksandr Byelkin [ 2014-01-22 ] |
|
The problem is that JOIN_TYPE_OUTER set on every execution but simplifying joins (outer to inner) ony once. |
| Comment by Oleksandr Byelkin [ 2014-01-22 ] |
|
sent for review. I think it should be fixed in 5.3 even without test suite. |
| Comment by Sergei Petrunia [ 2014-01-28 ] |
|
.. Patch approved. When I run the testcase on the latest 5.3, the bug is reproducible. (It is not reproducible if 5.3 is earlier than the fix for |