You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +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:
@ -63,13 +63,13 @@ select `mcs63_db`.`t1`.`t1_int` AS `t1_int`,`mcs63_db`.`t1`.`t1_char` AS `t1_cha
|
||||
SELECT * FROM v4;
|
||||
t1_int t1_char t2_int t2_char
|
||||
1 aaa 1 hhh
|
||||
3 ccc 3 iii
|
||||
5 eee 5 jjj
|
||||
7 gggg 7 llll
|
||||
NULL NULL NULL NULL
|
||||
2 bbb NULL NULL
|
||||
3 ccc NULL NULL
|
||||
4 ddd NULL NULL
|
||||
5 eee NULL NULL
|
||||
6 fff NULL NULL
|
||||
7 gggg NULL NULL
|
||||
CREATE VIEW v5 AS SELECT * FROM t1 RIGHT JOIN t2 ON t1.t1_int = t2.t2_int;
|
||||
SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME='v5' AND TABLE_SCHEMA='mcs63_db';
|
||||
VIEW_DEFINITION
|
||||
@ -105,10 +105,10 @@ select `mcs63_db`.`t1`.`t1_int` AS `t1_int`,`mcs63_db`.`t1`.`t1_char` AS `t1_cha
|
||||
SELECT * FROM v7;
|
||||
t1_int t1_char t2_int t2_char
|
||||
NULL NULL NULL NULL
|
||||
1 aaa 1 hhh
|
||||
3 ccc 3 iii
|
||||
NULL NULL 1 hhh
|
||||
NULL NULL 3 iii
|
||||
5 eee 5 jjj
|
||||
7 gggg 7 llll
|
||||
NULL NULL 7 llll
|
||||
NULL NULL 9 kkkk
|
||||
NULL NULL 11 mm
|
||||
NULL NULL 13 n
|
||||
|
Reference in New Issue
Block a user