[MDEV-3109] LP:809179 - Wrong result with derived_merge=on + right join Created: 2011-07-12  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: Igor Babaev
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug809179.xml    

 Description   

Even after the fix for 806504, the following query returns no rows even though there is a row that matches the WHERE predicate.

Not repeatable with derived_merge=off. Not repeatable without a derived table. Not repeatable in mysql-5.5. Not repeatable by rotating the join to a LEFT JOIN. Not repeatable with maria-5.3 before WL#106 .

explain:

1 PRIMARY t1 system NULL NULL NULL NULL 1  
1 PRIMARY t2 system NULL NULL NULL NULL 1  
1 PRIMARY t1 system NULL NULL NULL NULL 1  
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used

minimal optimizer_switch - derived_merge=on

full optimizer_switch:

index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=on,derived_with_keys=on,firstmatch=off,loosescan=off,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on

bzr version-info:

revision-id: <email address hidden>
date: 2011-07-11 10:56:48 -0700
build-date: 2011-07-12 11:17:24 +0300
revno: 3100
branch-nick: maria-5.3

test case:

DROP DATABASE IF NOT EXISTS bug;
CREATE DATABASE bug;
USE bug;

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( a int, b int) ;
INSERT IGNORE INTO t1 VALUES (6,5);

DROP TABLE IF EXISTS t2;
CREATE TABLE t2 ( a int, f4 int) ;
INSERT IGNORE INTO t2 VALUES (1,0);

SELECT alias2.a, alias2.b FROM t1 RIGHT JOIN ( ( SELECT * FROM t1 ) AS alias2 , t2) ON t2.f4 != 0 WHERE ( alias2.a , alias2.b ) NOT IN ( SELECT 7 , 5 );



 Comments   
Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ]

Launchpad bug id: 809179

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