[MDEV-3033] LP:856152 - Wrong result with NOT IN subquery and partial_match_rowid_merge Created: 2011-09-22  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: XML File LPexportBug856152.xml    

 Description   

The following query:

SELECT * FROM t2 WHERE ( 3 , 1 ) NOT IN ( SELECT f1 , f2 FROM t1 );

returns no rows when executed with partial_match_rowid_merge even though the WHERE clause is TRUE always. Even though this particular example has 1 row in t2, the issue was also observed with t2 having more than 1 row, in which case only some of the rows were returned.

Explain:

1 PRIMARY t2 system NULL NULL NULL NULL 1  
2 SUBQUERY t1 ALL NULL NULL NULL NULL 3  

test case:

CREATE TABLE t1 ( f1 integer NOT NULL , f2 integer) ;
INSERT INTO t1 VALUES (3,3),(48,NULL),(49,1);

CREATE TABLE t2 ( f3 int) ;
INSERT INTO t2 VALUES (5);

SET SESSION optimizer_switch='in_to_exists=off,materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off';
SELECT * FROM t2 WHERE ( 3 , 1 ) NOT IN ( SELECT f1 , f2 FROM t1 );

revision-id: <email address hidden>
date: 2011-09-22 01:55:17 +0400
build-date: 2011-09-22 09:45:27 +0300
revno: 3190
branch-nick: maria-5.3



 Comments   
Comment by Rasmus Johansson (Inactive) [ 2011-10-05 ]

Launchpad bug id: 856152

Generated at Thu Feb 08 06:45:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.