[MDEV-3392] LP:836532 - Crash in Item_equal_fields_iterator::get_curr_field with semijoin+materialization Created: 2011-08-29 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query: SELECT * crashes as follows: #3 <signal handler called> Explain also crashes. There are no empty or 1-row tables. minimal optimizer switch: semijoin=ON,materialization=ON full optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on bzr version-info: revision-id: <email address hidden> test case: CREATE TABLE t2 (a int); CREATE TABLE t4 (a varchar(1)); CREATE TABLE t3 (a varchar(1) , b varchar(1) ) ; CREATE TABLE t5 (a varchar(1), KEY (a)) ; SET SESSION optimizer_switch='semijoin=ON,materialization=ON'; SELECT * |
| Comments |
| Comment by Sergei Petrunia [ 2011-09-04 ] |
|
Re: Crash in Item_equal_fields_iterator::get_curr_field with semijoin+materialization (gdb) wher (gdb) up (gdb) up (gdb) p &cond_equal->current_level (gdb) p cond_equal->current_level.head() ^^^ So we went up and see that cond_equal->current_level, which is of type |
| Comment by Sergei Petrunia [ 2011-09-04 ] |
|
Re: Crash in Item_equal_fields_iterator::get_curr_field with semijoin+materialization #0 substitute_for_best_equal_field (cond=0xb1fad58, cond_equal=0xb1fadf4, table_join_idx=0xb1f9f10) at sql_select.cc:11412 and 'cond' was an Item_cond_and with the list of these four arguments: (gdb) p $i1 the two last two elements of the list: (gdb) p ((Item*)cond) (gdb) p ((Item*)cond) WERE THE SAME AS JOIN's cond_equal: (gdb) p this->cond_equal_ (gdb) p this->cond_equal_ (gdb) p this->cond_equal_ That is, List<Item> and List<Item_equal> somehow ended up sharing the tail of the list. substitute_for_best_equal_field() eventually executed this part of its code: /* which is ok for the List<Item> but made List<Item_equal> JOIN::cond_equal_ invalid. |
| Comment by Sergei Petrunia [ 2011-09-04 ] |
|
Re: Crash in Item_equal_fields_iterator::get_curr_field with semijoin+materialization (gdb) wher Here, we get this code: /* Attach back the list of multiple equalities to the new top-level AND. */ } and after the line marked with '>' executes, we get: (gdb) set $and_args=((class Item_cond*)join_arg->conds)->argument_list() i.e. the lists get mixed tails. |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 836532 |