[MDEV-3742] LP:912795 - Wrong result (missing rows) with exists_to_in=on, semijoin+firstmatch, MERGE views or derived_merge, MyISAM or Aria Created: 2012-01-06 Updated: 2014-06-20 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: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query SELECT * FROM v1, v2 on the test data returns 2 rows if it's run with exists_to_in=ON, and 4 rows otherwise. The latter is correct. I could not convert this test into an 'IN' subquery, because it is important for the test that the column `c` is selected in subselect, while the outer column is matched to `d`. So possibly the problem is related to exists2in. bzr version-info EXPLAIN with exists_to_in=ON (wrong result): id select_type table type possible_keys key key_len ref rows filtered Extra EXPLAIN with exists_to_in=OFF (correct result): id select_type table type possible_keys key key_len ref rows filtered Extra Minimal optimizer_switch: in_to_exists=on,semijoin=on,firstmatch=on,exists_to_in=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=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,exists_to_in=on Test case:
CREATE TABLE t1 ( a INT, b INT, c INT, KEY(a) ) ENGINE=MyISAM; CREATE TABLE t2 ( d INT, KEY(d) ); CREATE ALGORITHM=MERGE VIEW v1 AS CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1, v2
a b c d a b c
a b c d a b c |
| Comments |
| Comment by Elena Stepanova [ 2012-01-06 ] |
|
Re: Wrong result (missing rows) with exists_to_in=on, semijoin+firstmatch, MERGE views or derived_merge, MyISAM or Aria |
| Comment by Oleksandr Byelkin [ 2012-02-09 ] |
|
Re: Wrong result (missing rows) with exists_to_in=on, semijoin+firstmatch, MERGE views or derived_merge, MyISAM or Aria SET optimizer_switch = 'in_to_exists=on,semijoin=on,firstmatch=on,exists_to_in=on'; |
| Comment by Rasmus Johansson (Inactive) [ 2012-02-09 ] |
|
Launchpad bug id: 912795 |