[MDEV-3277] LP:803457 - Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90 Created: 2011-06-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 |
|
Not reproducible with maria-5.3 due to different query plan. Reproducible with derived_merge=off, derived_with_keys=off . The following query: SELECT * returns no rows with semijoin in maria-5.3-subqueries-mwl89, even though other execution plans and server versions agree that rows should be returned. Explain: id select_type table type possible_keys key key_len ref rows Extra minimal optimizer switch required: semijoin=on,firstmatch=off total optimizer_switch in effect: 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=on,materialization=off,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=off,mrr_sort_keys=on,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=on,table_elimination=on test case: SET SESSION optimizer_switch='semijoin=on,firstmatch=off'; CREATE TABLE t1 (f1 int, f2 int ); CREATE TABLE t2 (f2 int, f3 int ); CREATE TABLE t3 ( f1 int, f3 int ); CREATE TABLE t4 ( f2 int, KEY (f2) ); CREATE VIEW v4 AS SELECT DISTINCT f2 FROM t4 ; SELECT * bzr version-info: revision-id: <email address hidden> |
| Comments |
| Comment by Sergei Petrunia [ 2011-07-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90 MariaDB [j4]> create table tv4 as select * from v4; MariaDB [j4]> explain SELECT * FROM t1 NATURAL LEFT JOIN ( t2 , t3 ) WHERE t2.f3 IN ( SELECT * FROM tv4 );
---
--- MariaDB [j4]> SELECT * FROM t1 NATURAL LEFT JOIN ( t2 , t3 ) WHERE t2.f3 IN ( SELECT * FROM tv4 ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Launchpad bug id: 803457 |