1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-05-28 13:01:26 +03:00
Gagan Goel 22c7fb7c01 MCOL-4680 FROM subquery containing nested joins returns an error.
Main theme of the patch is to fix joins processing in the plugin
code. We now use SELECT_LEX::top_join_list and process the nested
joins recursively, instead of SELECT_LEX::table_list struct which
we earlier used to build the join filters. The earlier approach
did not process certain nested join ON expressions, causing certain
queries to incorrectly error out such as that described in MCOL-4680.

In addition, some legacy code is also removed.
2021-05-03 06:28:27 +00:00

30 lines
565 B
Plaintext

#
# FROM subquery containing nested joins returns an error
#
DROP DATABASE IF EXISTS mcol4680;
CREATE DATABASE mcol4680;
USE mcol4680;
create table t1 (a int);
insert into t1 values (1), (2), (3);
create table t2 (a int);
insert into t2 values (2);
create table t3 (a int);
create table t4 (a int);
create table t5 (a int);
select * from
(
select t1.a as col1, t2.a as col2 from
t1 left join
(
(t2 left join t3 on t2.a=t3.a) left join
(t4 left join t5 on t4.a=t5.a)
on t2.a=t4.a
)
on t1.a=t2.a
) h order by col1;
col1 col2
1 NULL
2 2
3 NULL
DROP DATABASE mcol4680;