[MDEV-18978] Server crashes in JOIN::optimize_inner with condition_pushdown_from_having=on upon 2nd execution of SP Created: 2019-03-20 Updated: 2019-04-09 Resolved: 2019-04-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.4 |
| Fix Version/s: | 10.4.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alice Sherepa | Assignee: | Galina Shalygina (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
|
| Comments |
| Comment by Alice Sherepa [ 2019-03-20 ] | |||||||||||||||||||||||
|
similar case, adding just to make it searchable:
| |||||||||||||||||||||||
| Comment by Galina Shalygina (Inactive) [ 2019-04-09 ] | |||||||||||||||||||||||
|
Why this bug appears: What is done on the first execution of stmt statement: 1. Pushdown from HAVING into WHERE is made. 2. Then pushdown into IN subquery is made. Condition from WHERE clause is saved to be pushed into IN subquery later. It is saved in cond_pushed_into_where field. 3. IN subquery is optimized. cond_pushed_into_where is pushed into IN subqueries WHERE clause. 4. IN subquery is executed. It is said to be degenerated and special flag is_jtbm_const_tab is set. On the second execution of stmt statement 1 step is repeated. On the 2 step it is checked if is_jtbm_const_tab is set. And it is set, it remains the same after the first execution. So pushdown into IN subquery is not made while is should be made. At the same time cond_pushed_into_where remains after the first execution. On the 3 step when optimize_cond() is called for IN subquery cond_pushed_into_where is tried to be joined to IN subquery. As it remains as it was on the first execution it causes crash. This bug is the same as |