[MDEV-3552] LP:834758 - Wrong result with innner join, LooseScan, two-column IN() predicate Created: 2011-08-26 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 * returns the matching row twice: -----
-----
----- whereas the correct result is: -----
-----
----- explain:
---
--- 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: CREATE TABLE t1 (b int) ; CREATE TABLE t2 (a int, PRIMARY KEY (a)) ; CREATE TABLE t3 (a int, b int, KEY (b)) ; SET SESSION optimizer_switch='loosescan=on'; SELECT * |
| Comments |
| Comment by Sergei Petrunia [ 2011-09-05 ] | ||||||||||||||||||||||||||||||
|
Re: Wrong result with innner join, LooseScan, two-column IN() predicate
is invalid, as LooseScan cannot be used together with "ALL" access method. LooseScan relies on table access method to produce duplicates grouped together, which is possible when access methods produce records in certain order. "ALL" is a full table scan, which does not guarantee any particular order. | ||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | ||||||||||||||||||||||||||||||
|
Launchpad bug id: 834758 |