[MDEV-3016] LP:934348 - Wrong result (missing rows) with materialization+semijoin+join_cache_hashed, join_cache_level>2, HAVING Created: 2012-02-17 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: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query SELECT a FROM t1 on the test data returns only one row if it's run with materialization, semijoin, join_cache_hashed and join_cache_level>2, and two rows otherwise. The latter is correct. bzr version-info EXPLAIN with join_cache_level = 3 (wrong result): id select_type table type possible_keys key key_len ref rows filtered Extra EXPLAIN with join_cache_level =2 (correct result): id select_type table type possible_keys key key_len ref rows filtered Extra Minimal optimizer_switch: materialization=on,semijoin=on,join_cache_hashed=on
SET optimizer_switch = 'materialization=on,semijoin=on,join_cache_hashed=on';
SELECT a FROM t1
|
| Comments |
| Comment by Igor Babaev [ 2012-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Wrong result (missing rows) with materialization+semijoin+join_cache_hashed, join_cache_level>2, HAVING MariaDB [test]> EXPLAIN SELECT a FROM t1 t WHERE t.a IN ( SELECT b FROM t1, t2 WHERE b = a ) GROUP BY t.a HAVING t.a != 'z';
---
--- The key to access t is built oveer column a of the materialized table. Yet there is no such column there. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2012-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Wrong result (missing rows) with materialization+semijoin+join_cache_hashed, join_cache_level>2, HAVING SET optimizer_switch = 'materialization=on,semijoin=on,join_cache_hashed=on'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2012-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Wrong result (missing rows) with materialization+semijoin+join_cache_hashed, join_cache_level>2, HAVING | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Launchpad bug id: 934348 |