Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Both maria-5.3 and maria-5.3-mwl128 return a wrong result on the following query:
SELECT alias1.f12 FROM t1 AS alias1 RIGHT JOIN t2 AS alias2 RIGHT JOIN t3 AS alias3 JOIN t3 AS alias4 ON alias3.f1 = alias4.f1 RIGHT JOIN t4 AS alias5 ON alias3.f6 = alias5.f2 ON alias2.f15 ON alias1.f1 = alias3.f1;
when it is executed with join_cache_level=6 and BKA.
Test case:
SET SESSION join_cache_level = 6;
SET SESSION optimizer_switch = 'join_cache_bka=on';
SET SESSION optimizer_switch = 'join_cache_incremental=on';
SET SESSION optimizer_switch = 'outer_join_with_cache=on';
CREATE TABLE t1 ( f1 int, f12 int, PRIMARY KEY (f1)) ;
INSERT IGNORE INTO t1 VALUES ('7','0');
CREATE TABLE t2 ( f15 int) ;
INSERT IGNORE INTO t2 VALUES ('9');
CREATE TABLE t3 ( f6 varchar(32), f1 int, PRIMARY KEY (f1)) ;
INSERT IGNORE INTO t3 VALUES ('s','7');
CREATE TABLE t4 ( f2 varchar(32)) ;
INSERT IGNORE INTO t4 VALUES ('s'),('k');
SELECT alias1.f12 FROM t1 AS alias1 RIGHT JOIN t2 AS alias2 RIGHT JOIN t3 AS alias3 JOIN t3 AS alias4 ON alias3.f1 = alias4.f1 RIGHT JOIN t4 AS alias5 ON alias3.f6 = alias5.f2 ON alias2.f15 ON alias1.f1 = alias3.f1;
SET SESSION join_cache_level=0;
SELECT alias1.f12 FROM t1 AS alias1 RIGHT JOIN t2 AS alias2 RIGHT JOIN t3 AS alias3 JOIN t3 AS alias4 ON alias3.f1 = alias4.f1 RIGHT JOIN t4 AS alias5 ON alias3.f6 = alias5.f2 ON alias2.f15 ON alias1.f1 = alias3.f1;