[MDEV-2616] LP:858732 - Wrong result with semijoin + loosescan + comma join Created: 2011-09-25 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 | ||
| Reporter: | Philip Stoev (Inactive) | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query SELECT * FROM t3 WHERE (f12) IN ( SELECT alias2.f12 FROM t1 AS alias1 , t2 AS alias2 , t1 WHERE alias1.f13 = 24 ); returns more rows than are in t3 when executed with semijoin + loosescan. explain: id select_type table type possible_keys key key_len ref rows filtered Extra explain extended: select `test`.`t3`.`f12` AS `f12` from `test`.`t1` `alias1` semi join (`test`.`t2` `alias2` join `test`.`t1`) join `test`.`t3` where ((`test`.`t3`.`f12` = `test`.`alias2`.`f12`)) minimal optimizer switch: semijoin=ON,loosescan=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=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=on,materialization=off,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=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: --source include/have_innodb.inc CREATE TABLE t2 ( f14 int(11) NOT NULL , f12 varchar(1) NOT NULL , KEY (f12,f14)) ENGINE=InnoDB; CREATE TABLE t3 ( f12 varchar(1) NOT NULL ) ENGINE=InnoDB; SET SESSION optimizer_switch='semijoin=ON,loosescan=ON'; returns "y", "y". Expected just a single "y". |
| Comments |
| Comment by Sergei Petrunia [ 2011-09-26 ] |
|
Re: Wrong result with semijoin + loosescan + comma join |
| Comment by Sergei Petrunia [ 2011-09-26 ] |
|
Re: Wrong result with semijoin + loosescan + comma join |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 858732 |