[MDEV-3746] LP:694443 - Wrong result with hash join and join_cache_level=6 Created: 2010-12-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: | Critical |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
In maria-5.3 , the following query: SELECT STRAIGHT_JOIN t1.f2 FROM t1 JOIN t2 ON t1.f4 = t2.f5 WHERE ( t2.f1 OR t2.f2 ) AND t2.f3 IS NULL ; returns no rows even though 1 row matches the WHERE predicate and is returned by all other plans. explain: id select_type table type possible_keys key key_len ref rows Extra test case: CREATE TABLE t1 (f2 int(11), f4 varchar(10)) ; CREATE TABLE t2 (f5 varchar(10), f2 int(11), f1 int(11), f3 int(11), KEY (f3)) ; SET SESSION join_cache_level=6; SET SESSION join_cache_level=0; Even though this particular test case includes join_cache_bka=off, the problematic query plan was also observed without having to force it. |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2010-12-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Wrong result with hash join and join_cache_level=6 revision-id: igor@askmonty.org-20101226025414-1opbueutu602o8eu | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2010-12-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Re: Wrong result with hash join and join_cache_level=6 MariaDB [test]> CREATE TABLE t1 (a int PRIMARY KEY); MariaDB [test]> INSERT INTO t1 VALUES MariaDB [test]> CREATE TABLE t2 (a int, b int, INDEX idx (a)); MariaDB [test]> INSERT INTO t2 VALUES MariaDB [test]> MariaDB [test]> EXPLAIN
---
--- MariaDB [test]> SELECT * FROM t1,t2 WHERE t1.a < 3 and t2.a IS NULL;
--
-- MariaDB [test]> SET SESSION join_cache_level = 4; MariaDB [test]> EXPLAIN
---
--- MariaDB [test]> SELECT * FROM t1,t2 WHERE t1.a < 3 and t2.a IS NULL; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Launchpad bug id: 694443 |