[MDEV-2510] LP:806431 - Wrong result with derived_with_keys=on and multiple WHERE conditions on the same field Created: 2011-07-06 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: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query SELECT * FROM t1 AS a1 JOIN v1 AS a2 WHERE a1.f2 = a2.f4 AND a1.f4 = a2.f4; does not return all matching rows when executed with derived_with_keys=on. Notice that the WHERE predicate references a2.f4 twice. test case: CREATE TABLE t1 (f2 int, f4 int); CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT f2, f4 FROM t1 ; SET SESSION optimizer_switch='derived_with_keys=on'; explain: ---
---
minimal optimizer switch: derived_with_keys=on; total 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=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,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 bzr version-info |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 806431 |