[MDEV-3589] LP:777597 - Wrong result with multipart keys, in_to_exists=on, NOT IN in mwl#89 Created: 2011-05-05 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: | Timour Katchaounov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Not repeatable in maria-5.3, maria-5.2. The following query SELECT * FROM t1 WHERE ( 6 ) NOT IN ( SELECT t2.f3 FROM t2 JOIN t3 ON t3.f10 = t2.f10);; returns rows when executed with in-to-exists even though the subquery returns (6),(6) which means that the NOT IN predicate should be FALSE, making the entire WHERE condition FALSE. The following things seem to be required:
Innodb is required for this particular test case, but the bug was just observed with MyISAM. EXPLAIN: id select_type table type possible_keys key key_len ref rows Extra test case: --source include/have_innodb.inc CREATE TABLE t1 ( f4 int); CREATE TABLE t2 ( f3 int, f10 int, KEY (f10,f3) ) ENGINE=InnoDB; CREATE TABLE t3 ( f10 int ); SET SESSION optimizer_switch='in_to_exists=on,materialization=off'; bzr version-info: revision-id: <email address hidden> |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2011-05-05 ] |
|
Re: Wrong result with multipart keys, in_to_exists=on, NOT IN in maria-5.3-mwl89 |
| Comment by Timour Katchaounov (Inactive) [ 2011-05-10 ] |
|
Re: Wrong result with multipart keys, in_to_exists=on, NOT IN in maria-5.3-mwl89 In the call chain during optimization of the subquery: #0 Item_cache::is_null (this=0x7f060c0b8ca8) at item.h:3519 The call to is_null() returns TRUE, which is wrong. This results in The inspecion of the Item_direct_ref->Item_cache_str object shows that: Let's investigate where/how Item_cache_str is updated.
outer_join->optimize()
|
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 777597 |