1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00
Files
mariadb-columnstore-engine/mysql-test/columnstore/autopilot/t/mcs6895_outerjoin_fourTables.test
Daniel Lee 4c9d6e39ac Dlee mtr restructure (#2494)
* Restructured test suites and added autopilot and extended suites

* Updated autopilot with correct branch - develop

* Moved setup test case to a 'setup' directory, for consistency

* Fixed a path issue

* Updated some tests cases to keep up with development

Co-authored-by: root <root@rocky8.localdomain>
2022-08-09 21:20:56 +03:00

354 lines
13 KiB
Plaintext
Executable File

# -------------------------------------------------------------- #
# Test case migrated from Autopilot outer join test suite
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE outerjoin;
#
# conventional, conventional, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join customer c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
where c_custkey < 10
order by 1, 2, 3, 4, 5, 6;
# conventional, conventional, conventional, with filter in subquery
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# conventional, conventional, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# conventional, conventional, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# conventional, left, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# conventional, left, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# conventional, left, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# conventional, right, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# conventional, right, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# conventional, right, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# left, conventional, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# left, conventional, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# left, conventional, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# left, left, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# left, left, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# left, left, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# left, right, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# left, right, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# left, right, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# left, conventional, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# left, conventional, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# left, conventional, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
left join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# right, left, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
right join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# right, left, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
right join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# right, left, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
right join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
left join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
# right, right, conventional
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
right join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# right, right, left
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
right join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
left join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
# right, right, right
select o.o_custkey, c.c_custkey,c.c_nationkey,n.n_nationkey,n.n_regionkey, r.r_regionkey from orders o
right join (select * from customer where c_custkey < 10) c on o.o_custkey = c.c_custkey
right join nation n on c.c_nationkey = n.n_nationkey
right join region r on n.n_regionkey = r.r_regionkey
order by 1, 2, 3, 4, 5, 6;
#
select * from t1
join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
left join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
left join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
left join t4 on t1.c=t4.c
order by 4;
#
select * from t1
right join t2 on t1.c=t2.c
right join t3 on t2.c=t3.c
right join t4 on t1.c=t4.c
order by 4;
#