[MDEV-3436] LP:836491 - Crash in Item_field::Item_field from add_ref_to_table_cond() 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: | Major |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query: SELECT t2.a, t1.c causes the following crash: #3 <signal handler called> Explain also crashes. Seems that t2 must have 1 row for the crash to happen. 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 t1 (c int, d varchar(1), KEY(d)) ; CREATE TABLE t2 (a int, d varchar(1)) ; CREATE TABLE t3 (d varchar(1)) ; SET SESSION optimizer_switch='semijoin=ON,materialization=ON'; SELECT t2.a, t1.c |
| Comments |
| Comment by Sergei Petrunia [ 2011-08-29 ] | ||||||||||||||||||||||||||||||||||||||||
|
Re: Crash in Item_field::Item_field from add_ref_to_table_cond() with semijoin+materialization MariaDB [bug836491]> create table t100 (a int, b int) ; MariaDB [bug836491]> insert into t100 select a,a from test.ten; MariaDB [bug836491]> create table t101 as select * from t100; MariaDB [bug836491]> explain select * from t100 where (a,b) in (select a,b from t101);
---
--- Breakpoint 21, create_tmp_table (thd=0xba91280, param=0xbaf535c, fields=@0xbaf53d8, group=0x0, distinct=true, save_sum_fields=true, select_options=2147768832, rows_limit=18446744073709551615, table_alias=0x89ac970 "sj-materialize", do_not_open=false) at sql_select.cc:13130 (gdb) p sjm->table->key_info[0].key_part[0].fieldnr One can see that the key has two key parts, and key_part[1].fieldnr==key_part[0].fieldnr, which is apparently wrong (a column can't be present in the key two times) | ||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2011-08-29 ] | ||||||||||||||||||||||||||||||||||||||||
|
Re: Crash in Item_field::Item_field from add_ref_to_table_cond() with semijoin+materialization In order to hit this bug, most of written-to-purpose materialization tests lack #1. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | ||||||||||||||||||||||||||||||||||||||||
|
Launchpad bug id: 836491 |