You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
[MCOL-5061] Fix wrong join id
assignment for the views. (#2474)
This patch fixes a wrong `join id` assignment for `TupleHashJoinStep` in a view. After MCOL-334 CS assigns a '-1' as `join id` for `TupleHashJoinStep` in a view, and in this case we cannot apply a filter for specific `Join step`, which is associated with `join id` for 2 reasons: 1. Filters for all `TupleHashJoinSteps` associated with the same `join id`, which is '-1'. 2. When CS creates a `joinIdIndexMap` it eliminates all `join ids` which a less or equal 0. This patch also fixes some tests for the view, which were generated wrong results.
This commit is contained in:
20
mysql-test/columnstore/bugfixes/mcol-5061.result
Normal file
20
mysql-test/columnstore/bugfixes/mcol-5061.result
Normal file
@ -0,0 +1,20 @@
|
||||
DROP DATABASE IF EXISTS mcol_5061;
|
||||
CREATE DATABASE mcol_5061;
|
||||
USE mcol_5061;
|
||||
create table t1 (a int, b int) engine=columnstore;
|
||||
create table t2 (a int, b int) engine=columnstore;
|
||||
insert into t1 values (1, 3), (2, 3), (3, 4);
|
||||
insert into t2 values (1, 2), (2, 4), (4, 5);
|
||||
select t1.a as a, t1.b as b, t2.a as c, t2.b as d, t2_1.a as e, t2_1.b as f from t1 left join t2 on (t1.a = t2.a and t2.a > 1) left join t2 as t2_1 on (t1.b = t2_1.b and t2_1.a > 1);
|
||||
a b c d e f
|
||||
1 3 NULL NULL NULL NULL
|
||||
2 3 2 4 NULL NULL
|
||||
3 4 NULL NULL 2 4
|
||||
create or replace view view_test as
|
||||
select t1.a as a, t1.b as b, t2.a as c, t2.b as d, t2_1.a as e, t2_1.b as f from t1 left join t2 on (t1.a = t2.a and t2.a > 1) left join t2 as t2_1 on (t1.b = t2_1.b and t2_1.a > 1);
|
||||
select * from view_test;
|
||||
a b c d e f
|
||||
1 3 NULL NULL NULL NULL
|
||||
2 3 2 4 NULL NULL
|
||||
3 4 NULL NULL 2 4
|
||||
DROP DATABASE mcol_5061;
|
26
mysql-test/columnstore/bugfixes/mcol-5061.test
Normal file
26
mysql-test/columnstore/bugfixes/mcol-5061.test
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# Test based on Jira MCOL-5061
|
||||
# Reduced customer test case.
|
||||
#
|
||||
|
||||
--source ../include/have_columnstore.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mcol_5061;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE mcol_5061;
|
||||
USE mcol_5061;
|
||||
|
||||
create table t1 (a int, b int) engine=columnstore;
|
||||
create table t2 (a int, b int) engine=columnstore;
|
||||
|
||||
insert into t1 values (1, 3), (2, 3), (3, 4);
|
||||
insert into t2 values (1, 2), (2, 4), (4, 5);
|
||||
select t1.a as a, t1.b as b, t2.a as c, t2.b as d, t2_1.a as e, t2_1.b as f from t1 left join t2 on (t1.a = t2.a and t2.a > 1) left join t2 as t2_1 on (t1.b = t2_1.b and t2_1.a > 1);
|
||||
|
||||
create or replace view view_test as
|
||||
select t1.a as a, t1.b as b, t2.a as c, t2.b as d, t2_1.a as e, t2_1.b as f from t1 left join t2 on (t1.a = t2.a and t2.a > 1) left join t2 as t2_1 on (t1.b = t2_1.b and t2_1.a > 1);
|
||||
select * from view_test;
|
||||
|
||||
DROP DATABASE mcol_5061;
|
Reference in New Issue
Block a user