[MDEV-2960] LP:778434 - Wrong result with in_to_exists=on in maria-5.3-mwl89 Created: 2011-05-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: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Not repeatable with maria-5.3. The following query: SELECT * FROM t1 INNER JOIN t2 ON t2.f10 = t1.f11 returns rows even though there is no value of 234 in the database and therefore there is no way for the IN predicate to be TRUE. EXPLAIN: id select_type table type possible_keys key key_len ref rows Extra test case: CREATE TABLE t1 ( f11 int) ; CREATE TABLE t2 ( f10 int) ; CREATE TABLE t3 ( f1 int NOT NULL , f10 int, PRIMARY KEY (f1)) ; CREATE TABLE t4 ( f11 int) ; SET SESSION optimizer_switch='materialization=off,in_to_exists=on,subquery_cache=off,semijoin=off'; SELECT * FROM t1 INNER JOIN t2 ON t2.f10 = t1.f11 |
| Comments |
| Comment by Timour Katchaounov (Inactive) [ 2011-06-22 ] |
|
Re: Wrong result with in_to_exists=on in maria-5.3-mwl89 CREATE TABLE t1 ( f11 int) ; CREATE TABLE t3 ( f1 int NOT NULL , f10 int, PRIMARY KEY (f1)) ; CREATE TABLE t4 ( f11 int) ; SELECT * FROM t1 WHERE (6, 0) IN (SELECT t3.f1, t3.f1 FROM t3, t4 WHERE t4.f11 = t3.f10); |
| Comment by Timour Katchaounov (Inactive) [ 2011-07-07 ] |
|
Re: Wrong result with in_to_exists=on in maria-5.3-mwl89 My current analysis shows that the condition on table t3 is |
| Comment by Timour Katchaounov (Inactive) [ 2011-07-07 ] |
|
Re: Wrong result with in_to_exists=on in maria-5.3-mwl89 if (active_index == pushed_idx_cond_keyno) is false (active_index = 64, pushed_idx_cond_keyno = 0). while ((info->lastpos >= info->state->data_file_length && the member info->index_cond_func is NULL, thus mi_check_index_cond() The method idx_cond_push() is called as follows: JOIN::optimize -> make_join_readinfo -> push_index_cond -> The most likely reason for active_index == MAX_KEY, and |
| Comment by Timour Katchaounov (Inactive) [ 2011-07-08 ] |
|
Re: Wrong result with in_to_exists=on in maria-5.3-mwl89 |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 778434 |