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
chore(codestyle): MCOL-5405: repace windows CRLF with virtious linux one
This commit is contained in:
committed by
Leonid Fedorov
parent
323c8822d5
commit
1d25cf3afd
@ -1,326 +1,326 @@
|
||||
# -------------------------------------------------------------- #
|
||||
# Test case migrated from regression test suite: bug3932.sql
|
||||
#
|
||||
# Author: Daniel Lee, daniel.lee@mariadb.com
|
||||
# -------------------------------------------------------------- #
|
||||
#
|
||||
--source ../include/have_columnstore.inc
|
||||
#
|
||||
USE tpch1;
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists qa_nation;
|
||||
drop table if exists qa_customer;
|
||||
drop table if exists qa_region;
|
||||
drop table if exists qa_orders;
|
||||
--enable_warnings
|
||||
|
||||
create table qa_nation (n_id int, n_name char(20), regionid int) engine=columnstore;
|
||||
create table qa_customer (c_id int, c_custname char(20), nationid int) engine=columnstore;
|
||||
create table qa_region (r_id int, r_name char(20)) engine=columnstore;
|
||||
create table qa_orders (o_id int, o_name char(20), custid int) engine=columnstore;
|
||||
|
||||
insert into qa_region values (1, 'ASIA'), (2, 'AMERICA'), (3, 'EUROPE');
|
||||
insert into qa_nation values (1, 'UNITED STATES', 2), (2, 'CANADA', 2), (3, 'JAPAN', 1), (4, 'CHINA', 1), (5, 'GERMANY', 3), (6, 'ITALY', 3);
|
||||
insert into qa_customer values (1, 'Cust_US', 1), (2, 'Cust_Japan', 3), (3, 'Cust_Italy', 6);
|
||||
insert into qa_orders values (1, 'Order_US#1', 1), (2, 'Order_US#2', 1), (3, 'Order_Japan#1', 2);
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by n.n_name;
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by n.n_name;
|
||||
|
||||
select n.n_name, count(c.c_id)
|
||||
from qa_nation n
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) group by n.n_name order by n.n_name;
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by n.n_name;
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by n.n_name;
|
||||
|
||||
select n.n_name, count(c.c_id)
|
||||
from qa_nation n
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) group by n.n_name order by n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Japan') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Italy') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Japan') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Italy') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Japan') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Italy') order by r.r_name, n.n_name;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists qa_nation;
|
||||
drop table if exists qa_customer;
|
||||
drop table if exists qa_region;
|
||||
drop table if exists qa_orders;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
# -------------------------------------------------------------- #
|
||||
# Test case migrated from regression test suite: bug3932.sql
|
||||
#
|
||||
# Author: Daniel Lee, daniel.lee@mariadb.com
|
||||
# -------------------------------------------------------------- #
|
||||
#
|
||||
--source ../include/have_columnstore.inc
|
||||
#
|
||||
USE tpch1;
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists qa_nation;
|
||||
drop table if exists qa_customer;
|
||||
drop table if exists qa_region;
|
||||
drop table if exists qa_orders;
|
||||
--enable_warnings
|
||||
|
||||
create table qa_nation (n_id int, n_name char(20), regionid int) engine=columnstore;
|
||||
create table qa_customer (c_id int, c_custname char(20), nationid int) engine=columnstore;
|
||||
create table qa_region (r_id int, r_name char(20)) engine=columnstore;
|
||||
create table qa_orders (o_id int, o_name char(20), custid int) engine=columnstore;
|
||||
|
||||
insert into qa_region values (1, 'ASIA'), (2, 'AMERICA'), (3, 'EUROPE');
|
||||
insert into qa_nation values (1, 'UNITED STATES', 2), (2, 'CANADA', 2), (3, 'JAPAN', 1), (4, 'CHINA', 1), (5, 'GERMANY', 3), (6, 'ITALY', 3);
|
||||
insert into qa_customer values (1, 'Cust_US', 1), (2, 'Cust_Japan', 3), (3, 'Cust_Italy', 6);
|
||||
insert into qa_orders values (1, 'Order_US#1', 1), (2, 'Order_US#2', 1), (3, 'Order_Japan#1', 2);
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by n.n_name;
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by n.n_name;
|
||||
|
||||
select n.n_name, count(c.c_id)
|
||||
from qa_nation n
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) group by n.n_name order by n.n_name;
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by n.n_name;
|
||||
|
||||
select n.n_name, c.c_custname
|
||||
from qa_nation n
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by n.n_name;
|
||||
|
||||
select n.n_name, count(c.c_id)
|
||||
from qa_nation n
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) group by n.n_name order by n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
left outer join qa_customer c on n.n_id = c.nationid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where n.n_id in (select n2.n_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and r1.r_name = 'AMERICA') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where r.r_id in (select r1.r_id from qa_nation n2, qa_region r1 where n2.regionid = r1.r_id and n2.n_name = 'UNITED STATES') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1) order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Japan') order by r.r_name, n.n_name, o.o_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Italy') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Japan') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Italy') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Japan') order by r.r_name, n.n_name;
|
||||
|
||||
select r.r_name, n.n_name, c.c_custname, o.o_name
|
||||
from qa_region r
|
||||
join qa_nation n on r.r_id = n.regionid
|
||||
join qa_customer c on n.n_id = c.nationid
|
||||
left outer join qa_orders o on c.c_id = o.custid
|
||||
where c.c_id in (select c1.c_id from qa_customer c1 where c1.c_custname = 'Cust_Italy') order by r.r_name, n.n_name;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists qa_nation;
|
||||
drop table if exists qa_customer;
|
||||
drop table if exists qa_region;
|
||||
drop table if exists qa_orders;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
|
@ -8,13 +8,13 @@
|
||||
#
|
||||
USE tpch1;
|
||||
#
|
||||
set autocommit=0;
|
||||
update lineitem a join region b on b.r_regionkey = a.l_orderkey set b.r_regionkey=2;
|
||||
select * from region;
|
||||
rollback;
|
||||
select * from region;
|
||||
update region b join lineitem a on b.r_regionkey = a.l_orderkey set b.r_regionkey=2;
|
||||
select * from region;
|
||||
rollback;
|
||||
set autocommit=0;
|
||||
update lineitem a join region b on b.r_regionkey = a.l_orderkey set b.r_regionkey=2;
|
||||
select * from region;
|
||||
rollback;
|
||||
select * from region;
|
||||
update region b join lineitem a on b.r_regionkey = a.l_orderkey set b.r_regionkey=2;
|
||||
select * from region;
|
||||
rollback;
|
||||
select * from region;#
|
||||
|
||||
|
@ -1,82 +1,82 @@
|
||||
# -------------------------------------------------------------- #
|
||||
# Test case migrated from regression test suite: bug3998.sql
|
||||
#
|
||||
# Author: Daniel Lee, daniel.lee@mariadb.com
|
||||
# -------------------------------------------------------------- #
|
||||
#
|
||||
--source ../include/have_columnstore.inc
|
||||
#
|
||||
USE tpch1;
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists bug3998a;
|
||||
drop table if exists bug3998b;
|
||||
drop table if exists bug3998c;
|
||||
drop table if exists bug3998d;
|
||||
--enable_warnings
|
||||
|
||||
create table bug3998a (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998a values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998a;
|
||||
|
||||
create table bug3998b (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998b values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998b;
|
||||
|
||||
create table bug3998c (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998c values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998c;
|
||||
|
||||
create table bug3998d (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998d values (1,1), (2,1), (5, 1), (null,1), (null, null);
|
||||
select * from bug3998d;
|
||||
|
||||
update bug3998a left join bug3998d on bug3998a.c1 = bug3998d.c1 set bug3998a.c1=9;
|
||||
select * from bug3998a;
|
||||
|
||||
update bug3998b join bug3998d on bug3998b.c1 = bug3998d.c1 set bug3998b.c1=9;
|
||||
select * from bug3998b;
|
||||
|
||||
update bug3998c right join bug3998d on bug3998c.c1 = bug3998d.c1 set bug3998c.c1=9;
|
||||
select * from bug3998c;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists bug3998a;
|
||||
drop table if exists bug3998b;
|
||||
drop table if exists bug3998c;
|
||||
drop table if exists bug3998d;
|
||||
--enable_warnings
|
||||
|
||||
create table bug3998a (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998a values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998a;
|
||||
|
||||
create table bug3998b (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998b values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998b;
|
||||
|
||||
create table bug3998c (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998c values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998c;
|
||||
|
||||
create table bug3998d (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998d values (1,1), (2,1), (5, 1), (null,1), (null, null);
|
||||
select * from bug3998d;
|
||||
|
||||
delete a from bug3998a a left join bug3998d d on a.c1 = d.c1;
|
||||
select * from bug3998a;
|
||||
|
||||
delete b from bug3998b b join bug3998d d on b.c1 = d.c1;
|
||||
select * from bug3998b;
|
||||
|
||||
delete c from bug3998c c right join bug3998d d on c.c1 = d.c1;
|
||||
select * from bug3998c;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists bug3998a;
|
||||
drop table if exists bug3998b;
|
||||
drop table if exists bug3998c;
|
||||
drop table if exists bug3998d;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
# -------------------------------------------------------------- #
|
||||
# Test case migrated from regression test suite: bug3998.sql
|
||||
#
|
||||
# Author: Daniel Lee, daniel.lee@mariadb.com
|
||||
# -------------------------------------------------------------- #
|
||||
#
|
||||
--source ../include/have_columnstore.inc
|
||||
#
|
||||
USE tpch1;
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists bug3998a;
|
||||
drop table if exists bug3998b;
|
||||
drop table if exists bug3998c;
|
||||
drop table if exists bug3998d;
|
||||
--enable_warnings
|
||||
|
||||
create table bug3998a (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998a values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998a;
|
||||
|
||||
create table bug3998b (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998b values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998b;
|
||||
|
||||
create table bug3998c (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998c values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998c;
|
||||
|
||||
create table bug3998d (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998d values (1,1), (2,1), (5, 1), (null,1), (null, null);
|
||||
select * from bug3998d;
|
||||
|
||||
update bug3998a left join bug3998d on bug3998a.c1 = bug3998d.c1 set bug3998a.c1=9;
|
||||
select * from bug3998a;
|
||||
|
||||
update bug3998b join bug3998d on bug3998b.c1 = bug3998d.c1 set bug3998b.c1=9;
|
||||
select * from bug3998b;
|
||||
|
||||
update bug3998c right join bug3998d on bug3998c.c1 = bug3998d.c1 set bug3998c.c1=9;
|
||||
select * from bug3998c;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists bug3998a;
|
||||
drop table if exists bug3998b;
|
||||
drop table if exists bug3998c;
|
||||
drop table if exists bug3998d;
|
||||
--enable_warnings
|
||||
|
||||
create table bug3998a (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998a values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998a;
|
||||
|
||||
create table bug3998b (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998b values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998b;
|
||||
|
||||
create table bug3998c (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998c values (0,0), (1,1), (2,1), (3, 1), (null,1), (null, null);
|
||||
select * from bug3998c;
|
||||
|
||||
create table bug3998d (c1 int, c2 int) engine=columnstore;
|
||||
insert into bug3998d values (1,1), (2,1), (5, 1), (null,1), (null, null);
|
||||
select * from bug3998d;
|
||||
|
||||
delete a from bug3998a a left join bug3998d d on a.c1 = d.c1;
|
||||
select * from bug3998a;
|
||||
|
||||
delete b from bug3998b b join bug3998d d on b.c1 = d.c1;
|
||||
select * from bug3998b;
|
||||
|
||||
delete c from bug3998c c right join bug3998d d on c.c1 = d.c1;
|
||||
select * from bug3998c;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists bug3998a;
|
||||
drop table if exists bug3998b;
|
||||
drop table if exists bug3998c;
|
||||
drop table if exists bug3998d;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
|
@ -1,37 +1,37 @@
|
||||
# -------------------------------------------------------------- #
|
||||
# Test case migrated from regression test suite: MCOL-4126.sql
|
||||
#
|
||||
# Author: Daniel Lee, daniel.lee@mariadb.com
|
||||
# -------------------------------------------------------------- #
|
||||
#
|
||||
--source ../include/have_columnstore.inc
|
||||
#
|
||||
USE tpch1;
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists T4126_1;
|
||||
drop table if exists T4126_2;
|
||||
--enable_warnings
|
||||
|
||||
create table T4126_1 (idx int, col varchar(20)) engine=columnstore;
|
||||
create table T4126_2 (idx int, col varchar(20), col2 varchar(20)) engine=columnstore;
|
||||
insert into T4126_1 values (3, 'a');
|
||||
select * from T4126_1;
|
||||
|
||||
insert into T4126_2 values (1, 'lamp', 'table lamp');
|
||||
select * from T4126_2;
|
||||
update T4126_2 set col = "floor lamp" where col = 'lamp';
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists T4126_1;
|
||||
drop table if exists T4126_2;
|
||||
--enable_warnings
|
||||
|
||||
create table T4126_1 (idx1 int, col1 varchar(20)) engine=columnstore;
|
||||
insert into T4126_1 values (3, 'a');
|
||||
select * from T4126_1;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists T4126_1;
|
||||
--enable_warnings
|
||||
#
|
||||
# -------------------------------------------------------------- #
|
||||
# Test case migrated from regression test suite: MCOL-4126.sql
|
||||
#
|
||||
# Author: Daniel Lee, daniel.lee@mariadb.com
|
||||
# -------------------------------------------------------------- #
|
||||
#
|
||||
--source ../include/have_columnstore.inc
|
||||
#
|
||||
USE tpch1;
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists T4126_1;
|
||||
drop table if exists T4126_2;
|
||||
--enable_warnings
|
||||
|
||||
create table T4126_1 (idx int, col varchar(20)) engine=columnstore;
|
||||
create table T4126_2 (idx int, col varchar(20), col2 varchar(20)) engine=columnstore;
|
||||
insert into T4126_1 values (3, 'a');
|
||||
select * from T4126_1;
|
||||
|
||||
insert into T4126_2 values (1, 'lamp', 'table lamp');
|
||||
select * from T4126_2;
|
||||
update T4126_2 set col = "floor lamp" where col = 'lamp';
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists T4126_1;
|
||||
drop table if exists T4126_2;
|
||||
--enable_warnings
|
||||
|
||||
create table T4126_1 (idx1 int, col1 varchar(20)) engine=columnstore;
|
||||
insert into T4126_1 values (3, 'a');
|
||||
select * from T4126_1;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists T4126_1;
|
||||
--enable_warnings
|
||||
#
|
||||
|
@ -1,76 +1,76 @@
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1_compareLogOnly/storedProcedures/sp.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists sp_simple_select;
|
||||
drop procedure if exists sp_simple_variable;
|
||||
drop procedure if exists sp_simple_variables;
|
||||
drop procedure if exists sp_complex_variable;
|
||||
drop procedure if exists proc1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
DELIMITER $$;
|
||||
Create Procedure sp_simple_select( )
|
||||
begin
|
||||
select * from part where p_partkey < 5;
|
||||
end $$
|
||||
|
||||
# Simple SP with 1 arg
|
||||
Create Procedure sp_simple_variable(in arg_key int)
|
||||
begin
|
||||
select * from part where p_partkey <= arg_key;
|
||||
end $$
|
||||
|
||||
# Simple SP with multiple args
|
||||
Create Procedure sp_simple_variables(in arg_key int, in arg_string varchar(25))
|
||||
begin
|
||||
select * from nation where n_nationkey <= arg_key and n_name > arg_string;
|
||||
end $$
|
||||
|
||||
# Simple SP with cross table select query
|
||||
Create Procedure sp_complex_variable(in arg_key int, in arg_date date)
|
||||
begin
|
||||
Select * from lineitem, orders where o_custkey < arg_key and
|
||||
l_partkey < 10000 and l_shipdate>arg_date and l_orderkey = o_orderkey order by l_orderkey, l_linenumber;
|
||||
end $$
|
||||
|
||||
# SP with DDL
|
||||
create procedure proc1()
|
||||
begin
|
||||
create table if not exists t1 (id int)engine=columnstore;
|
||||
start transaction;
|
||||
alter table t1 add column c3 integer;
|
||||
insert into t1 values (1,2);
|
||||
commit;
|
||||
end$$
|
||||
|
||||
DELIMITER ;$$
|
||||
|
||||
call sp_simple_select;
|
||||
call sp_simple_variable(2);
|
||||
call sp_simple_variables(10, 'AMERICA');
|
||||
call sp_complex_variable(1000, '1998-10-10');
|
||||
call proc1();
|
||||
# Should get 'Duplicate column name' error this time
|
||||
--error 1060
|
||||
call proc1();
|
||||
|
||||
--disable_warnings
|
||||
drop table t1;
|
||||
drop procedure sp_simple_select;
|
||||
drop procedure sp_simple_variable;
|
||||
drop procedure sp_simple_variables;
|
||||
drop procedure sp_complex_variable;
|
||||
drop procedure proc1;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1_compareLogOnly/storedProcedures/sp.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists sp_simple_select;
|
||||
drop procedure if exists sp_simple_variable;
|
||||
drop procedure if exists sp_simple_variables;
|
||||
drop procedure if exists sp_complex_variable;
|
||||
drop procedure if exists proc1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
DELIMITER $$;
|
||||
Create Procedure sp_simple_select( )
|
||||
begin
|
||||
select * from part where p_partkey < 5;
|
||||
end $$
|
||||
|
||||
# Simple SP with 1 arg
|
||||
Create Procedure sp_simple_variable(in arg_key int)
|
||||
begin
|
||||
select * from part where p_partkey <= arg_key;
|
||||
end $$
|
||||
|
||||
# Simple SP with multiple args
|
||||
Create Procedure sp_simple_variables(in arg_key int, in arg_string varchar(25))
|
||||
begin
|
||||
select * from nation where n_nationkey <= arg_key and n_name > arg_string;
|
||||
end $$
|
||||
|
||||
# Simple SP with cross table select query
|
||||
Create Procedure sp_complex_variable(in arg_key int, in arg_date date)
|
||||
begin
|
||||
Select * from lineitem, orders where o_custkey < arg_key and
|
||||
l_partkey < 10000 and l_shipdate>arg_date and l_orderkey = o_orderkey order by l_orderkey, l_linenumber;
|
||||
end $$
|
||||
|
||||
# SP with DDL
|
||||
create procedure proc1()
|
||||
begin
|
||||
create table if not exists t1 (id int)engine=columnstore;
|
||||
start transaction;
|
||||
alter table t1 add column c3 integer;
|
||||
insert into t1 values (1,2);
|
||||
commit;
|
||||
end$$
|
||||
|
||||
DELIMITER ;$$
|
||||
|
||||
call sp_simple_select;
|
||||
call sp_simple_variable(2);
|
||||
call sp_simple_variables(10, 'AMERICA');
|
||||
call sp_complex_variable(1000, '1998-10-10');
|
||||
call proc1();
|
||||
# Should get 'Duplicate column name' error this time
|
||||
--error 1060
|
||||
call proc1();
|
||||
|
||||
--disable_warnings
|
||||
drop table t1;
|
||||
drop procedure sp_simple_select;
|
||||
drop procedure sp_simple_variable;
|
||||
drop procedure sp_simple_variables;
|
||||
drop procedure sp_complex_variable;
|
||||
drop procedure proc1;
|
||||
--enable_warnings
|
||||
#
|
||||
|
@ -1,171 +1,171 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1_compareLogOnly/storedProcedures/sp_autoswitch.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
# Simple SP without args
|
||||
DELIMITER $$;
|
||||
drop procedure if exists sp_simple_select;
|
||||
|
||||
Create Procedure sp_simple_select( )
|
||||
begin
|
||||
select * from part where p_partkey < 5;
|
||||
end $$
|
||||
|
||||
# Simple SP with 1 arg
|
||||
drop procedure if exists sp_simple_variable;
|
||||
|
||||
Create Procedure sp_simple_variable(in arg_key int)
|
||||
begin
|
||||
select * from part where p_partkey <= arg_key;
|
||||
end $$
|
||||
|
||||
# Simple SP with multiple args
|
||||
drop procedure if exists sp_simple_variables;
|
||||
|
||||
Create Procedure sp_simple_variables(in arg_key int, in arg_string varchar(25))
|
||||
begin
|
||||
select * from nation where n_nationkey <= arg_key and n_name > arg_string;
|
||||
end $$
|
||||
|
||||
# Simple SP with cross table select query
|
||||
drop procedure if exists sp_complex_variable;
|
||||
|
||||
Create Procedure sp_complex_variable(in arg_key int, in arg_date date)
|
||||
begin
|
||||
Select * from lineitem, orders where o_custkey < arg_key and
|
||||
l_partkey < 10000 and l_shipdate>arg_date and l_orderkey = o_orderkey order by l_orderkey, l_linenumber;
|
||||
end $$
|
||||
|
||||
# Complex SP. All following SPs will fail vtable mode
|
||||
drop procedure if exists sp_unstructured_loop;
|
||||
|
||||
Create Procedure sp_unstructured_loop(in arg_key int)
|
||||
begin
|
||||
declare v_col1 int;
|
||||
declare v_col2 char(122);
|
||||
declare no_more_rows boolean ;
|
||||
declare cursor1 cursor for
|
||||
select p_partkey, p_name from part where p_partkey <= arg_key;
|
||||
declare continue handler for not found
|
||||
set no_more_rows := TRUE;
|
||||
set no_more_rows := false;
|
||||
open cursor1;
|
||||
LOOP1: loop
|
||||
fetch cursor1
|
||||
into v_col1, v_col2
|
||||
;
|
||||
if no_more_rows then
|
||||
close cursor1;
|
||||
leave LOOP1;
|
||||
end if;
|
||||
--
|
||||
select v_col1, v_col2;
|
||||
--
|
||||
end loop LOOP1;
|
||||
end$$
|
||||
|
||||
|
||||
drop procedure if exists sp_repeat_loop;
|
||||
|
||||
Create Procedure sp_repeat_loop(in arg_key int, in arg_key2 int)
|
||||
begin
|
||||
DECLARE done INT DEFAULT 0;
|
||||
DECLARE a CHAR(122);
|
||||
DECLARE b INT;
|
||||
DECLARE cur1
|
||||
CURSOR FOR
|
||||
SELECT p_partkey, p_name
|
||||
FROM part where p_partkey between arg_key and arg_key2;
|
||||
DECLARE
|
||||
CONTINUE HANDLER FOR
|
||||
SQLSTATE '02000'
|
||||
SET done = 1;
|
||||
|
||||
OPEN cur1;
|
||||
|
||||
REPEAT
|
||||
FETCH cur1 INTO b, a;
|
||||
if not done then
|
||||
select b, a;
|
||||
end if;
|
||||
UNTIL
|
||||
done
|
||||
END REPEAT;
|
||||
|
||||
CLOSE cur1;
|
||||
end$$
|
||||
|
||||
drop procedure if exists sp_while_loop;
|
||||
|
||||
Create Procedure sp_while_loop(in arg_key int, in arg_key2 int)
|
||||
begin
|
||||
DECLARE done INT DEFAULT 0;
|
||||
DECLARE a CHAR(116);
|
||||
DECLARE b INT;
|
||||
DECLARE cur1
|
||||
CURSOR FOR
|
||||
SELECT p_partkey, p_name
|
||||
FROM part where p_partkey between arg_key and arg_key2;
|
||||
DECLARE
|
||||
CONTINUE HANDLER FOR
|
||||
SQLSTATE '02000'
|
||||
SET done = 1;
|
||||
|
||||
OPEN cur1;
|
||||
|
||||
FETCH cur1 INTO b, a;
|
||||
WHILE NOT done DO
|
||||
if not done then
|
||||
select b, a;
|
||||
end if;
|
||||
FETCH cur1 INTO b, a;
|
||||
END WHILE;
|
||||
|
||||
CLOSE cur1;
|
||||
end$$
|
||||
|
||||
# SP with DDL
|
||||
drop procedure if exists proc1;
|
||||
|
||||
create procedure proc1()
|
||||
begin
|
||||
drop table if exists t1;
|
||||
create table if not exists t1 (id int)engine=columnstore;
|
||||
start transaction;
|
||||
alter table t1 add column c3 integer;
|
||||
insert into t1 values (1,2);
|
||||
select * into @a, @b from t1;
|
||||
drop table t1;
|
||||
commit;
|
||||
end$$
|
||||
|
||||
DELIMITER ;$$
|
||||
call sp_simple_select;
|
||||
call sp_simple_variable(2);
|
||||
call sp_simple_variables(10, 'AMERICA');
|
||||
call sp_complex_variable(1000, '1998-10-10');
|
||||
call sp_unstructured_loop(2);
|
||||
call sp_repeat_loop(1,2);
|
||||
call sp_while_loop(1,2);
|
||||
call proc1();
|
||||
select @a, @b;
|
||||
|
||||
--disable_warnings
|
||||
drop procedure sp_simple_select;
|
||||
drop procedure sp_simple_variable;
|
||||
drop procedure sp_simple_variables;
|
||||
drop procedure sp_complex_variable;
|
||||
drop procedure sp_unstructured_loop;
|
||||
drop procedure sp_repeat_loop;
|
||||
drop procedure sp_while_loop;
|
||||
drop procedure proc1;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1_compareLogOnly/storedProcedures/sp_autoswitch.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
# Simple SP without args
|
||||
DELIMITER $$;
|
||||
drop procedure if exists sp_simple_select;
|
||||
|
||||
Create Procedure sp_simple_select( )
|
||||
begin
|
||||
select * from part where p_partkey < 5;
|
||||
end $$
|
||||
|
||||
# Simple SP with 1 arg
|
||||
drop procedure if exists sp_simple_variable;
|
||||
|
||||
Create Procedure sp_simple_variable(in arg_key int)
|
||||
begin
|
||||
select * from part where p_partkey <= arg_key;
|
||||
end $$
|
||||
|
||||
# Simple SP with multiple args
|
||||
drop procedure if exists sp_simple_variables;
|
||||
|
||||
Create Procedure sp_simple_variables(in arg_key int, in arg_string varchar(25))
|
||||
begin
|
||||
select * from nation where n_nationkey <= arg_key and n_name > arg_string;
|
||||
end $$
|
||||
|
||||
# Simple SP with cross table select query
|
||||
drop procedure if exists sp_complex_variable;
|
||||
|
||||
Create Procedure sp_complex_variable(in arg_key int, in arg_date date)
|
||||
begin
|
||||
Select * from lineitem, orders where o_custkey < arg_key and
|
||||
l_partkey < 10000 and l_shipdate>arg_date and l_orderkey = o_orderkey order by l_orderkey, l_linenumber;
|
||||
end $$
|
||||
|
||||
# Complex SP. All following SPs will fail vtable mode
|
||||
drop procedure if exists sp_unstructured_loop;
|
||||
|
||||
Create Procedure sp_unstructured_loop(in arg_key int)
|
||||
begin
|
||||
declare v_col1 int;
|
||||
declare v_col2 char(122);
|
||||
declare no_more_rows boolean ;
|
||||
declare cursor1 cursor for
|
||||
select p_partkey, p_name from part where p_partkey <= arg_key;
|
||||
declare continue handler for not found
|
||||
set no_more_rows := TRUE;
|
||||
set no_more_rows := false;
|
||||
open cursor1;
|
||||
LOOP1: loop
|
||||
fetch cursor1
|
||||
into v_col1, v_col2
|
||||
;
|
||||
if no_more_rows then
|
||||
close cursor1;
|
||||
leave LOOP1;
|
||||
end if;
|
||||
--
|
||||
select v_col1, v_col2;
|
||||
--
|
||||
end loop LOOP1;
|
||||
end$$
|
||||
|
||||
|
||||
drop procedure if exists sp_repeat_loop;
|
||||
|
||||
Create Procedure sp_repeat_loop(in arg_key int, in arg_key2 int)
|
||||
begin
|
||||
DECLARE done INT DEFAULT 0;
|
||||
DECLARE a CHAR(122);
|
||||
DECLARE b INT;
|
||||
DECLARE cur1
|
||||
CURSOR FOR
|
||||
SELECT p_partkey, p_name
|
||||
FROM part where p_partkey between arg_key and arg_key2;
|
||||
DECLARE
|
||||
CONTINUE HANDLER FOR
|
||||
SQLSTATE '02000'
|
||||
SET done = 1;
|
||||
|
||||
OPEN cur1;
|
||||
|
||||
REPEAT
|
||||
FETCH cur1 INTO b, a;
|
||||
if not done then
|
||||
select b, a;
|
||||
end if;
|
||||
UNTIL
|
||||
done
|
||||
END REPEAT;
|
||||
|
||||
CLOSE cur1;
|
||||
end$$
|
||||
|
||||
drop procedure if exists sp_while_loop;
|
||||
|
||||
Create Procedure sp_while_loop(in arg_key int, in arg_key2 int)
|
||||
begin
|
||||
DECLARE done INT DEFAULT 0;
|
||||
DECLARE a CHAR(116);
|
||||
DECLARE b INT;
|
||||
DECLARE cur1
|
||||
CURSOR FOR
|
||||
SELECT p_partkey, p_name
|
||||
FROM part where p_partkey between arg_key and arg_key2;
|
||||
DECLARE
|
||||
CONTINUE HANDLER FOR
|
||||
SQLSTATE '02000'
|
||||
SET done = 1;
|
||||
|
||||
OPEN cur1;
|
||||
|
||||
FETCH cur1 INTO b, a;
|
||||
WHILE NOT done DO
|
||||
if not done then
|
||||
select b, a;
|
||||
end if;
|
||||
FETCH cur1 INTO b, a;
|
||||
END WHILE;
|
||||
|
||||
CLOSE cur1;
|
||||
end$$
|
||||
|
||||
# SP with DDL
|
||||
drop procedure if exists proc1;
|
||||
|
||||
create procedure proc1()
|
||||
begin
|
||||
drop table if exists t1;
|
||||
create table if not exists t1 (id int)engine=columnstore;
|
||||
start transaction;
|
||||
alter table t1 add column c3 integer;
|
||||
insert into t1 values (1,2);
|
||||
select * into @a, @b from t1;
|
||||
drop table t1;
|
||||
commit;
|
||||
end$$
|
||||
|
||||
DELIMITER ;$$
|
||||
call sp_simple_select;
|
||||
call sp_simple_variable(2);
|
||||
call sp_simple_variables(10, 'AMERICA');
|
||||
call sp_complex_variable(1000, '1998-10-10');
|
||||
call sp_unstructured_loop(2);
|
||||
call sp_repeat_loop(1,2);
|
||||
call sp_while_loop(1,2);
|
||||
call proc1();
|
||||
select @a, @b;
|
||||
|
||||
--disable_warnings
|
||||
drop procedure sp_simple_select;
|
||||
drop procedure sp_simple_variable;
|
||||
drop procedure sp_simple_variables;
|
||||
drop procedure sp_complex_variable;
|
||||
drop procedure sp_unstructured_loop;
|
||||
drop procedure sp_repeat_loop;
|
||||
drop procedure sp_while_loop;
|
||||
drop procedure proc1;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
|
@ -1,179 +1,179 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1_compareLogOnly/partitionOptimization/aCreateViews.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop view if exists v_nation;
|
||||
drop view if exists v_region;
|
||||
drop view if exists v_customer;
|
||||
drop view if exists v_orders;
|
||||
drop view if exists v_supplier;
|
||||
drop view if exists v_partsupp;
|
||||
drop view if exists v_part;
|
||||
drop view if exists v_lineitem;
|
||||
--enable_warnings
|
||||
|
||||
create view v_nation as select * from nation where n_nationkey > 10 union all select * from nation where n_nationkey <= 10;
|
||||
create view v_region as select * from region where r_regionkey > 3 union all select * from region where r_regionkey <= 3;
|
||||
create view v_customer as select * from customer union all select * from customer where c_custkey=0;
|
||||
create view v_orders as select * from orders union all select * from orders where o_orderkey=0;
|
||||
create view v_supplier as select * from supplier union all select * from supplier where s_suppkey=0;
|
||||
create view v_partsupp as select * from partsupp union all select * from partsupp where ps_partkey=0;
|
||||
create view v_part as select * from part union all select * from part where p_partkey=0;
|
||||
create view v_lineitem as select * from lineitem union all select * from lineitem where l_orderkey=0;
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists ordersColumnsTouched;
|
||||
drop procedure if exists lineitemColumnsTouched;
|
||||
drop procedure if exists customerColumnsTouched;
|
||||
drop procedure if exists supplierColumnsTouched;
|
||||
drop procedure if exists partColumnsTouched;
|
||||
drop procedure if exists partsuppColumnsTouched;
|
||||
drop procedure if exists regionColumnsTouched;
|
||||
drop procedure if exists nationColumnsTouched;
|
||||
drop procedure if exists eliminatedBlocksGE;
|
||||
--enable_warnings
|
||||
|
||||
delimiter //;
|
||||
create procedure ordersColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('o_orderkey', trace) > 0 as o_orderkey_accessed;
|
||||
select locate('o_custkey', trace) > 0 as o_custkey_accessed;
|
||||
select locate('o_orderstatus', trace) > 0 as o_orderstatus_accessed;
|
||||
select locate('o_totalprice', trace) > 0 as o_totalprice_accessed;
|
||||
select locate('o_orderdate', trace) > 0 as o_orderdate_accessed;
|
||||
select locate('o_orderpriority', trace) > 0 as o_orderpriority_accessed;
|
||||
select locate('o_clerk', trace) > 0 as o_clerk_accessed;
|
||||
select locate('o_shippriority', trace) > 0 as o_shippriority_accessed;
|
||||
select locate('o_comment', trace) > 0 as o_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure lineitemColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('l_orderkey', trace) > 0 as l_orderkey_accessed;
|
||||
select locate('l_partkey', trace) > 0 as l_partkey_accessed;
|
||||
select locate('l_suppkey', trace) > 0 as l_suppkey_accessed;
|
||||
select locate('l_linenumber', trace) > 0 as l_linenumber_accessed;
|
||||
select locate('l_quantity', trace) > 0 as l_quantity_accessed;
|
||||
select locate('l_extendedprice', trace) > 0 as l_extendedprice_accessed;
|
||||
select locate('l_discount', trace) > 0 as l_discount_accessed;
|
||||
select locate('l_tax', trace) > 0 as l_tax_accessed;
|
||||
select locate('l_returnflag', trace) > 0 as l_returnflag_accessed;
|
||||
select locate('l_linestatus', trace) > 0 as l_linestatus_accessed;
|
||||
select locate('l_shipdate', trace) > 0 as l_shipdate_accessed;
|
||||
select locate('l_commitdate', trace) > 0 as l_commitdate_accessed;
|
||||
select locate('l_receiptdate', trace) > 0 as l_receiptdate_accessed;
|
||||
select locate('l_shipinstruct', trace) > 0 as l_shipinstruct_accessed;
|
||||
select locate('l_shipmode', trace) > 0 as l_shipmode_accessed;
|
||||
select locate('l_comment', trace) > 0 as l_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure customerColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('c_custkey', trace) > 0 as c_custkey_accessed;
|
||||
select locate('c_name', trace) > 0 as c_name_accessed;
|
||||
select locate('c_address', trace) > 0 as c_address_accessed;
|
||||
select locate('c_nationkey', trace) > 0 as c_nationkey_accessed;
|
||||
select locate('c_phone', trace) > 0 as c_phone_accessed;
|
||||
select locate('c_acctbal', trace) > 0 as c_acctbal_accessed;
|
||||
select locate('c_mktsegment', trace) > 0 as c_mktsegment_accessed;
|
||||
select locate('c_comment', trace) > 0 as c_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure partColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('p_partkey', trace) > 0 as p_partkey_accessed;
|
||||
select locate('p_name', trace) > 0 as p_name_accessed;
|
||||
select locate('p_mfgr', trace) > 0 as p_mfgr_accessed;
|
||||
select locate('p_brand', trace) > 0 as p_brand_accessed;
|
||||
select locate('p_type', trace) > 0 as p_type_accessed;
|
||||
select locate('p_size', trace) > 0 as p_size_accessed;
|
||||
select locate('p_container', trace) > 0 as p_container_accessed;
|
||||
select locate('p_retailprice', trace) > 0 as p_retailprice_accessed;
|
||||
select locate('p_comment', trace) > 0 as p_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure partsuppColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('ps_partkey', trace) > 0 as ps_partkey_accessed;
|
||||
select locate('ps_suppkey', trace) > 0 as ps_suppkey_accessed;
|
||||
select locate('ps_availqty', trace) > 0 as ps_availqty_accessed;
|
||||
select locate('ps_supplycost', trace) > 0 as ps_supplycost_accessed;
|
||||
select locate('ps_comment', trace) > 0 as ps_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure supplierColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('s_suppkey', trace) > 0 as s_suppkey_accessed;
|
||||
select locate('s_name', trace) > 0 as s_name_accessed;
|
||||
select locate('s_address', trace) > 0 as s_address_accessed;
|
||||
select locate('s_nationkey', trace) > 0 as s_nationkey_accessed;
|
||||
select locate('s_phone', trace) > 0 as s_phone_accessed;
|
||||
select locate('s_acctbal', trace) > 0 as s_acctbal_accessed;
|
||||
select locate('s_comment', trace) > 0 as s_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure nationColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('n_nationkey', trace) > 0 as n_nationkey_accessed;
|
||||
select locate('n_name', trace) > 0 as n_name_accessed;
|
||||
select locate('n_regionkey', trace) > 0 as n_regionkey_accessed;
|
||||
select locate('n_comment', trace) > 0 as n_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure regionColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('r_regionkey', trace) > 0 as r_regionkey_accessed;
|
||||
select locate('r_name', trace) > 0 as r_name_accessed;
|
||||
select locate('r_comment', trace) > 0 as r_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure eliminatedBlocksGE(in blocks int) BEGIN
|
||||
select calgetstats() into @stats;
|
||||
select substr(@stats, locate('PartitionBlocksEliminated', @stats)+26, 999) into @temp;
|
||||
select substr(@temp, 1, locate(';', @temp)-1) into @blocksEliminated;
|
||||
select concat('Blocks eliminated ', if(@blocksEliminated >= blocks, 'is ', 'is not '), 'greater than or equal to ', blocks, '.') as 'CP Result';
|
||||
END //
|
||||
delimiter ;//
|
||||
|
||||
select count(*) as lineitem_count from lineitem;
|
||||
select count(*) as v_lineitem_count from v_lineitem;
|
||||
select count(*) as orders_count from orders;
|
||||
select count(*) as v_orders_count from v_orders;
|
||||
select count(*) as part_count from part;
|
||||
select count(*) as v_part_count from v_part;
|
||||
select count(*) as partsupp_count from partsupp;
|
||||
select count(*) as v_partsupp_count from v_partsupp;
|
||||
select count(*) as customer_count from customer;
|
||||
select count(*) as v_customer_count from v_customer;
|
||||
select count(*) as supplier_count from supplier;
|
||||
select count(*) as v_supplier_count from v_supplier;
|
||||
select count(*) as region_count from region;
|
||||
select count(*) as v_region_count from v_region;
|
||||
select count(*) as nation_count from nation;
|
||||
select count(*) as v_nation_count from v_nation;
|
||||
|
||||
# Clean up
|
||||
--disable_warnings
|
||||
drop view if exists v_nation;
|
||||
drop view if exists v_region;
|
||||
drop view if exists v_customer;
|
||||
drop view if exists v_orders;
|
||||
drop view if exists v_supplier;
|
||||
drop view if exists v_partsupp;
|
||||
drop view if exists v_part;
|
||||
drop view if exists v_lineitem;
|
||||
#
|
||||
drop procedure if exists ordersColumnsTouched;
|
||||
drop procedure if exists lineitemColumnsTouched;
|
||||
drop procedure if exists customerColumnsTouched;
|
||||
drop procedure if exists supplierColumnsTouched;
|
||||
drop procedure if exists partColumnsTouched;
|
||||
drop procedure if exists partsuppColumnsTouched;
|
||||
drop procedure if exists regionColumnsTouched;
|
||||
drop procedure if exists nationColumnsTouched;
|
||||
drop procedure if exists eliminatedBlocksGE;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1_compareLogOnly/partitionOptimization/aCreateViews.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop view if exists v_nation;
|
||||
drop view if exists v_region;
|
||||
drop view if exists v_customer;
|
||||
drop view if exists v_orders;
|
||||
drop view if exists v_supplier;
|
||||
drop view if exists v_partsupp;
|
||||
drop view if exists v_part;
|
||||
drop view if exists v_lineitem;
|
||||
--enable_warnings
|
||||
|
||||
create view v_nation as select * from nation where n_nationkey > 10 union all select * from nation where n_nationkey <= 10;
|
||||
create view v_region as select * from region where r_regionkey > 3 union all select * from region where r_regionkey <= 3;
|
||||
create view v_customer as select * from customer union all select * from customer where c_custkey=0;
|
||||
create view v_orders as select * from orders union all select * from orders where o_orderkey=0;
|
||||
create view v_supplier as select * from supplier union all select * from supplier where s_suppkey=0;
|
||||
create view v_partsupp as select * from partsupp union all select * from partsupp where ps_partkey=0;
|
||||
create view v_part as select * from part union all select * from part where p_partkey=0;
|
||||
create view v_lineitem as select * from lineitem union all select * from lineitem where l_orderkey=0;
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists ordersColumnsTouched;
|
||||
drop procedure if exists lineitemColumnsTouched;
|
||||
drop procedure if exists customerColumnsTouched;
|
||||
drop procedure if exists supplierColumnsTouched;
|
||||
drop procedure if exists partColumnsTouched;
|
||||
drop procedure if exists partsuppColumnsTouched;
|
||||
drop procedure if exists regionColumnsTouched;
|
||||
drop procedure if exists nationColumnsTouched;
|
||||
drop procedure if exists eliminatedBlocksGE;
|
||||
--enable_warnings
|
||||
|
||||
delimiter //;
|
||||
create procedure ordersColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('o_orderkey', trace) > 0 as o_orderkey_accessed;
|
||||
select locate('o_custkey', trace) > 0 as o_custkey_accessed;
|
||||
select locate('o_orderstatus', trace) > 0 as o_orderstatus_accessed;
|
||||
select locate('o_totalprice', trace) > 0 as o_totalprice_accessed;
|
||||
select locate('o_orderdate', trace) > 0 as o_orderdate_accessed;
|
||||
select locate('o_orderpriority', trace) > 0 as o_orderpriority_accessed;
|
||||
select locate('o_clerk', trace) > 0 as o_clerk_accessed;
|
||||
select locate('o_shippriority', trace) > 0 as o_shippriority_accessed;
|
||||
select locate('o_comment', trace) > 0 as o_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure lineitemColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('l_orderkey', trace) > 0 as l_orderkey_accessed;
|
||||
select locate('l_partkey', trace) > 0 as l_partkey_accessed;
|
||||
select locate('l_suppkey', trace) > 0 as l_suppkey_accessed;
|
||||
select locate('l_linenumber', trace) > 0 as l_linenumber_accessed;
|
||||
select locate('l_quantity', trace) > 0 as l_quantity_accessed;
|
||||
select locate('l_extendedprice', trace) > 0 as l_extendedprice_accessed;
|
||||
select locate('l_discount', trace) > 0 as l_discount_accessed;
|
||||
select locate('l_tax', trace) > 0 as l_tax_accessed;
|
||||
select locate('l_returnflag', trace) > 0 as l_returnflag_accessed;
|
||||
select locate('l_linestatus', trace) > 0 as l_linestatus_accessed;
|
||||
select locate('l_shipdate', trace) > 0 as l_shipdate_accessed;
|
||||
select locate('l_commitdate', trace) > 0 as l_commitdate_accessed;
|
||||
select locate('l_receiptdate', trace) > 0 as l_receiptdate_accessed;
|
||||
select locate('l_shipinstruct', trace) > 0 as l_shipinstruct_accessed;
|
||||
select locate('l_shipmode', trace) > 0 as l_shipmode_accessed;
|
||||
select locate('l_comment', trace) > 0 as l_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure customerColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('c_custkey', trace) > 0 as c_custkey_accessed;
|
||||
select locate('c_name', trace) > 0 as c_name_accessed;
|
||||
select locate('c_address', trace) > 0 as c_address_accessed;
|
||||
select locate('c_nationkey', trace) > 0 as c_nationkey_accessed;
|
||||
select locate('c_phone', trace) > 0 as c_phone_accessed;
|
||||
select locate('c_acctbal', trace) > 0 as c_acctbal_accessed;
|
||||
select locate('c_mktsegment', trace) > 0 as c_mktsegment_accessed;
|
||||
select locate('c_comment', trace) > 0 as c_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure partColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('p_partkey', trace) > 0 as p_partkey_accessed;
|
||||
select locate('p_name', trace) > 0 as p_name_accessed;
|
||||
select locate('p_mfgr', trace) > 0 as p_mfgr_accessed;
|
||||
select locate('p_brand', trace) > 0 as p_brand_accessed;
|
||||
select locate('p_type', trace) > 0 as p_type_accessed;
|
||||
select locate('p_size', trace) > 0 as p_size_accessed;
|
||||
select locate('p_container', trace) > 0 as p_container_accessed;
|
||||
select locate('p_retailprice', trace) > 0 as p_retailprice_accessed;
|
||||
select locate('p_comment', trace) > 0 as p_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure partsuppColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('ps_partkey', trace) > 0 as ps_partkey_accessed;
|
||||
select locate('ps_suppkey', trace) > 0 as ps_suppkey_accessed;
|
||||
select locate('ps_availqty', trace) > 0 as ps_availqty_accessed;
|
||||
select locate('ps_supplycost', trace) > 0 as ps_supplycost_accessed;
|
||||
select locate('ps_comment', trace) > 0 as ps_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure supplierColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('s_suppkey', trace) > 0 as s_suppkey_accessed;
|
||||
select locate('s_name', trace) > 0 as s_name_accessed;
|
||||
select locate('s_address', trace) > 0 as s_address_accessed;
|
||||
select locate('s_nationkey', trace) > 0 as s_nationkey_accessed;
|
||||
select locate('s_phone', trace) > 0 as s_phone_accessed;
|
||||
select locate('s_acctbal', trace) > 0 as s_acctbal_accessed;
|
||||
select locate('s_comment', trace) > 0 as s_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure nationColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('n_nationkey', trace) > 0 as n_nationkey_accessed;
|
||||
select locate('n_name', trace) > 0 as n_name_accessed;
|
||||
select locate('n_regionkey', trace) > 0 as n_regionkey_accessed;
|
||||
select locate('n_comment', trace) > 0 as n_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure regionColumnsTouched (in trace varchar(10000)) BEGIN
|
||||
select locate('r_regionkey', trace) > 0 as r_regionkey_accessed;
|
||||
select locate('r_name', trace) > 0 as r_name_accessed;
|
||||
select locate('r_comment', trace) > 0 as r_comment_accessed;
|
||||
END //
|
||||
|
||||
create procedure eliminatedBlocksGE(in blocks int) BEGIN
|
||||
select calgetstats() into @stats;
|
||||
select substr(@stats, locate('PartitionBlocksEliminated', @stats)+26, 999) into @temp;
|
||||
select substr(@temp, 1, locate(';', @temp)-1) into @blocksEliminated;
|
||||
select concat('Blocks eliminated ', if(@blocksEliminated >= blocks, 'is ', 'is not '), 'greater than or equal to ', blocks, '.') as 'CP Result';
|
||||
END //
|
||||
delimiter ;//
|
||||
|
||||
select count(*) as lineitem_count from lineitem;
|
||||
select count(*) as v_lineitem_count from v_lineitem;
|
||||
select count(*) as orders_count from orders;
|
||||
select count(*) as v_orders_count from v_orders;
|
||||
select count(*) as part_count from part;
|
||||
select count(*) as v_part_count from v_part;
|
||||
select count(*) as partsupp_count from partsupp;
|
||||
select count(*) as v_partsupp_count from v_partsupp;
|
||||
select count(*) as customer_count from customer;
|
||||
select count(*) as v_customer_count from v_customer;
|
||||
select count(*) as supplier_count from supplier;
|
||||
select count(*) as v_supplier_count from v_supplier;
|
||||
select count(*) as region_count from region;
|
||||
select count(*) as v_region_count from v_region;
|
||||
select count(*) as nation_count from nation;
|
||||
select count(*) as v_nation_count from v_nation;
|
||||
|
||||
# Clean up
|
||||
--disable_warnings
|
||||
drop view if exists v_nation;
|
||||
drop view if exists v_region;
|
||||
drop view if exists v_customer;
|
||||
drop view if exists v_orders;
|
||||
drop view if exists v_supplier;
|
||||
drop view if exists v_partsupp;
|
||||
drop view if exists v_part;
|
||||
drop view if exists v_lineitem;
|
||||
#
|
||||
drop procedure if exists ordersColumnsTouched;
|
||||
drop procedure if exists lineitemColumnsTouched;
|
||||
drop procedure if exists customerColumnsTouched;
|
||||
drop procedure if exists supplierColumnsTouched;
|
||||
drop procedure if exists partColumnsTouched;
|
||||
drop procedure if exists partsuppColumnsTouched;
|
||||
drop procedure if exists regionColumnsTouched;
|
||||
drop procedure if exists nationColumnsTouched;
|
||||
drop procedure if exists eliminatedBlocksGE;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
|
@ -1,40 +1,40 @@
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/view/view_sp.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
# VIEW used by Stored Procedure
|
||||
create or replace view v_temp as select * from part where p_partkey<10;
|
||||
DELIMITER $$;
|
||||
drop procedure if exists sp_simple_select;
|
||||
Create Procedure sp_simple_select( )
|
||||
begin
|
||||
select * from v_temp where p_partkey < 5;
|
||||
end $$
|
||||
|
||||
# Simple SP with 1 arg
|
||||
drop procedure if exists sp_simple_variable;
|
||||
|
||||
Create Procedure sp_simple_variable(in arg_key int)
|
||||
begin
|
||||
select * from v_temp where p_partkey <= arg_key;
|
||||
end $$
|
||||
DELIMITER ;$$
|
||||
|
||||
call sp_simple_select;
|
||||
call sp_simple_variable(2);
|
||||
|
||||
--disable_warnings
|
||||
drop procedure sp_simple_select;
|
||||
drop procedure sp_simple_variable;
|
||||
drop view v_temp;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/view/view_sp.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
# VIEW used by Stored Procedure
|
||||
create or replace view v_temp as select * from part where p_partkey<10;
|
||||
DELIMITER $$;
|
||||
drop procedure if exists sp_simple_select;
|
||||
Create Procedure sp_simple_select( )
|
||||
begin
|
||||
select * from v_temp where p_partkey < 5;
|
||||
end $$
|
||||
|
||||
# Simple SP with 1 arg
|
||||
drop procedure if exists sp_simple_variable;
|
||||
|
||||
Create Procedure sp_simple_variable(in arg_key int)
|
||||
begin
|
||||
select * from v_temp where p_partkey <= arg_key;
|
||||
end $$
|
||||
DELIMITER ;$$
|
||||
|
||||
call sp_simple_select;
|
||||
call sp_simple_variable(2);
|
||||
|
||||
--disable_warnings
|
||||
drop procedure sp_simple_select;
|
||||
drop procedure sp_simple_variable;
|
||||
drop view v_temp;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
|
@ -1,34 +1,34 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/misc/MCOL-829.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
# Support INSERT...SELECT in stored procedures
|
||||
--disable_warnings
|
||||
drop table if exists mcol829a;
|
||||
drop table if exists mcol829b;
|
||||
drop procedure if exists mcol829;
|
||||
--enable_warnings
|
||||
|
||||
create table mcol829a (a int, b int) engine=columnstore;
|
||||
create table mcol829b (a int, b int) engine=columnstore;
|
||||
insert into mcol829a values (1,1),(2,2),(3,3);
|
||||
delimiter //;
|
||||
create procedure mcol829() begin insert into mcol829b select * from mcol829a; end//
|
||||
delimiter ;//
|
||||
call mcol829();
|
||||
select * from mcol829b;
|
||||
|
||||
--disable_warnings
|
||||
drop procedure mcol829;
|
||||
drop table mcol829a;
|
||||
drop table mcol829b;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/misc/MCOL-829.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
# Support INSERT...SELECT in stored procedures
|
||||
--disable_warnings
|
||||
drop table if exists mcol829a;
|
||||
drop table if exists mcol829b;
|
||||
drop procedure if exists mcol829;
|
||||
--enable_warnings
|
||||
|
||||
create table mcol829a (a int, b int) engine=columnstore;
|
||||
create table mcol829b (a int, b int) engine=columnstore;
|
||||
insert into mcol829a values (1,1),(2,2),(3,3);
|
||||
delimiter //;
|
||||
create procedure mcol829() begin insert into mcol829b select * from mcol829a; end//
|
||||
delimiter ;//
|
||||
call mcol829();
|
||||
select * from mcol829b;
|
||||
|
||||
--disable_warnings
|
||||
drop procedure mcol829;
|
||||
drop table mcol829a;
|
||||
drop table mcol829b;
|
||||
--enable_warnings
|
||||
#
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.1.1.1.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select max(l_shipdate), min(l_orderkey), sum(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.1.1.1.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select max(l_shipdate), min(l_orderkey), sum(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
|
@ -1,13 +1,13 @@
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.1.1.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select * from lineitem where l_orderkey < 1400 order by l_orderkey, l_linenumber;
|
||||
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.1.1.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select * from lineitem where l_orderkey < 1400 order by l_orderkey, l_linenumber;
|
||||
|
@ -1,15 +1,15 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.2.1.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select count(*) from part, lineitem
|
||||
where p_retailprice < 944.23
|
||||
and p_partkey = l_suppkey
|
||||
and l_shipdate < '1992-04-09';
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.2.1.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select count(*) from part, lineitem
|
||||
where p_retailprice < 944.23
|
||||
and p_partkey = l_suppkey
|
||||
and l_shipdate < '1992-04-09';
|
||||
|
@ -1,15 +1,15 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.2.1.3.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select count(*) from part, lineitem
|
||||
where p_retailprice < 904.01
|
||||
and p_partkey = l_suppkey
|
||||
and l_shipdate < '1993-04-07';
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.2.1.3.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select count(*) from part, lineitem
|
||||
where p_retailprice < 904.01
|
||||
and p_partkey = l_suppkey
|
||||
and l_shipdate < '1993-04-07';
|
||||
|
@ -1,15 +1,15 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.2.1.4.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select count(*) from part, lineitem
|
||||
where p_retailprice < 913.65
|
||||
and p_partkey = l_suppkey
|
||||
and l_shipdate < '1993-04-07';
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.2.1.4.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select count(*) from part, lineitem
|
||||
where p_retailprice < 913.65
|
||||
and p_partkey = l_suppkey
|
||||
and l_shipdate < '1993-04-07';
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.1.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select min(l_suppkey) from lineitem;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.1.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select min(l_suppkey) from lineitem;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select max(l_shipdate) from lineitem;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select max(l_shipdate) from lineitem;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.3.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select sum(l_orderkey) from lineitem where l_suppkey < 100000;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.3.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select sum(l_orderkey) from lineitem where l_suppkey < 100000;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.4.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select avg(l_extendedprice) from lineitem;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.4.4.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select avg(l_extendedprice) from lineitem;
|
||||
|
@ -1,19 +1,19 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.6.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select p_brand, sum(l_quantity) tot_qty,
|
||||
avg(l_quantity) avg_qty, count(*)
|
||||
from part, lineitem
|
||||
where l_shipdate between '1996-04-01' and '1996-04-14'
|
||||
and p_size = 5
|
||||
and p_partkey = l_partkey
|
||||
group by p_brand
|
||||
order by 1;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q2.3.6.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select p_brand, sum(l_quantity) tot_qty,
|
||||
avg(l_quantity) avg_qty, count(*)
|
||||
from part, lineitem
|
||||
where l_shipdate between '1996-04-01' and '1996-04-14'
|
||||
and p_size = 5
|
||||
and p_partkey = l_partkey
|
||||
group by p_brand
|
||||
order by 1;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select max(l_shipdate), count(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select max(l_shipdate), count(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.4.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select o_orderdate, o_custkey from orders,lineitem where o_custkey < 100 and o_orderkey = l_orderkey order by 1, 2;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.4.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select o_orderdate, o_custkey from orders,lineitem where o_custkey < 100 and o_orderkey = l_orderkey order by 1, 2;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.6.1.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select c_custkey, o_orderkey from customer left outer join orders on c_custkey = o_custkey where c_custkey < 1000 and c_nationkey = 4 order by 1, 2;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.6.1.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select c_custkey, o_orderkey from customer left outer join orders on c_custkey = o_custkey where c_custkey < 1000 and c_nationkey = 4 order by 1, 2;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.6.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select c_custkey, o_orderkey from orders right outer join customer on c_custkey = o_custkey where c_custkey < 1000 and c_nationkey = 4 order by 1, 2;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.6.2.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select c_custkey, o_orderkey from orders right outer join customer on c_custkey = o_custkey where c_custkey < 1000 and c_nationkey = 4 order by 1, 2;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.6.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select * from lineitem, orders where o_custkey < 1000 and l_partkey < 10000 and l_orderkey = o_orderkey order by l_orderkey, l_linenumber;
|
||||
#
|
||||
# Test case migrated from regression test suite:
|
||||
# queries/working_tpch1/group/q4.6.sql
|
||||
#
|
||||
# Author: Susil, susil.behera@mariadb.com
|
||||
#
|
||||
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select * from lineitem, orders where o_custkey < 1000 and l_partkey < 10000 and l_orderkey = o_orderkey order by l_orderkey, l_linenumber;
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select * from lineitem where l_orderkey = 6000000000 order by l_orderkey, l_linenumber;
|
||||
select * from lineitem where l_orderkey = 6000000000 order by l_orderkey, l_linenumber;
|
||||
|
@ -9,5 +9,5 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select l_shipdate, l_suppkey, l_quantity, l_extendedprice, l_comment
|
||||
from lineitem where l_orderkey = 6000000000 order by 1, 2, 3, 4, 5;
|
||||
select l_shipdate, l_suppkey, l_quantity, l_extendedprice, l_comment
|
||||
from lineitem where l_orderkey = 6000000000 order by 1, 2, 3, 4, 5;
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select max(l_shipdate), min(l_orderkey), sum(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
Select max(l_shipdate), min(l_orderkey), sum(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select max(l_shipdate), count(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
select max(l_shipdate), count(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select * from lineitem where l_orderkey = 6000000000 order by l_orderkey, l_linenumber;
|
||||
select * from lineitem where l_orderkey = 6000000000 order by l_orderkey, l_linenumber;
|
||||
|
@ -9,5 +9,5 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select l_shipdate, l_suppkey, l_quantity, l_extendedprice, l_comment
|
||||
from lineitem where l_orderkey = 6000000000 order by 1, 2, 3, 4, 5;
|
||||
select l_shipdate, l_suppkey, l_quantity, l_extendedprice, l_comment
|
||||
from lineitem where l_orderkey = 6000000000 order by 1, 2, 3, 4, 5;
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select max(l_shipdate), count(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
select max(l_shipdate), count(l_partkey) from lineitem where l_orderkey < 1000000;
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
Select /* ! INFINIDB_ORDERED */ min(o_orderdate), max(o_custkey) from orders, lineitem where l_partkey < 100000 and l_orderkey = o_orderkey;
|
||||
Select /* ! INFINIDB_ORDERED */ min(o_orderdate), max(o_custkey) from orders, lineitem where l_partkey < 100000 and l_orderkey = o_orderkey;
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select * from lineitem where l_orderkey = 6000000000 order by l_orderkey, l_linenumber;
|
||||
select * from lineitem where l_orderkey = 6000000000 order by l_orderkey, l_linenumber;
|
||||
|
@ -9,5 +9,5 @@
|
||||
|
||||
USE tpch1;
|
||||
|
||||
select l_shipdate, l_suppkey, l_quantity, l_extendedprice, l_comment
|
||||
from lineitem where l_orderkey = 6000000000 order by 1, 2, 3, 4, 5;
|
||||
select l_shipdate, l_suppkey, l_quantity, l_extendedprice, l_comment
|
||||
from lineitem where l_orderkey = 6000000000 order by 1, 2, 3, 4, 5;
|
||||
|
@ -8,12 +8,12 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q1.3
|
||||
select sum(lo_extendedprice*lo_discount) as revenue
|
||||
from dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and d_weeknuminyear = 6
|
||||
and d_year = 1994
|
||||
and lo_orderdate between 19940101 and 19941231 # added matching predicate
|
||||
and lo_discount between 5 and 7
|
||||
and lo_quantity between 26 and 35;
|
||||
# Q1.3
|
||||
select sum(lo_extendedprice*lo_discount) as revenue
|
||||
from dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and d_weeknuminyear = 6
|
||||
and d_year = 1994
|
||||
and lo_orderdate between 19940101 and 19941231 # added matching predicate
|
||||
and lo_discount between 5 and 7
|
||||
and lo_quantity between 26 and 35;
|
||||
|
@ -8,13 +8,13 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q2.1
|
||||
select sum(lo_revenue), d_year, p_brand1
|
||||
from part, supplier, dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and p_category = 'MFGR#12'
|
||||
and s_region = 'AMERICA'
|
||||
group by d_year, p_brand1
|
||||
order by d_year, p_brand1;
|
||||
# Q2.1
|
||||
select sum(lo_revenue), d_year, p_brand1
|
||||
from part, supplier, dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and p_category = 'MFGR#12'
|
||||
and s_region = 'AMERICA'
|
||||
group by d_year, p_brand1
|
||||
order by d_year, p_brand1;
|
||||
|
@ -8,14 +8,14 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q2.2
|
||||
select sum(lo_revenue), d_year, p_brand1
|
||||
from part, supplier, dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and p_brand1 between 'MFGR#2221'
|
||||
and 'MFGR#2228'
|
||||
and s_region = 'ASIA'
|
||||
group by d_year, p_brand1
|
||||
order by d_year, p_brand1;
|
||||
# Q2.2
|
||||
select sum(lo_revenue), d_year, p_brand1
|
||||
from part, supplier, dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and p_brand1 between 'MFGR#2221'
|
||||
and 'MFGR#2228'
|
||||
and s_region = 'ASIA'
|
||||
group by d_year, p_brand1
|
||||
order by d_year, p_brand1;
|
||||
|
@ -8,13 +8,13 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q2.3
|
||||
select sum(lo_revenue), d_year, p_brand1
|
||||
from part, supplier, dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and p_brand1= 'MFGR#2239'
|
||||
and s_region = 'EUROPE'
|
||||
group by d_year, p_brand1
|
||||
order by d_year, p_brand1;
|
||||
# Q2.3
|
||||
select sum(lo_revenue), d_year, p_brand1
|
||||
from part, supplier, dateinfo, lineorder # changed order
|
||||
where lo_orderdate = d_datekey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and p_brand1= 'MFGR#2239'
|
||||
and s_region = 'EUROPE'
|
||||
group by d_year, p_brand1
|
||||
order by d_year, p_brand1;
|
||||
|
@ -8,15 +8,15 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q3.1
|
||||
select c_nation, s_nation, d_year,
|
||||
sum(lo_revenue) as revenue
|
||||
from customer, supplier, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_region = 'ASIA'
|
||||
and s_region = 'ASIA'
|
||||
and d_year >= 1992 and d_year <= 1997
|
||||
group by c_nation, s_nation, d_year
|
||||
order by d_year asc, revenue desc;
|
||||
# Q3.1
|
||||
select c_nation, s_nation, d_year,
|
||||
sum(lo_revenue) as revenue
|
||||
from customer, supplier, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_region = 'ASIA'
|
||||
and s_region = 'ASIA'
|
||||
and d_year >= 1992 and d_year <= 1997
|
||||
group by c_nation, s_nation, d_year
|
||||
order by d_year asc, revenue desc;
|
||||
|
@ -8,15 +8,15 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q3.2
|
||||
select c_city, s_city, d_year, sum(lo_revenue)
|
||||
as revenue
|
||||
from customer, supplier, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_nation = 'UNITED STATES'
|
||||
and s_nation = 'UNITED STATES'
|
||||
and d_year >= 1992 and d_year <= 1997
|
||||
group by c_city, s_city, d_year
|
||||
order by d_year asc, revenue desc;
|
||||
# Q3.2
|
||||
select c_city, s_city, d_year, sum(lo_revenue)
|
||||
as revenue
|
||||
from customer, supplier, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_nation = 'UNITED STATES'
|
||||
and s_nation = 'UNITED STATES'
|
||||
and d_year >= 1992 and d_year <= 1997
|
||||
group by c_city, s_city, d_year
|
||||
order by d_year asc, revenue desc;
|
||||
|
@ -8,17 +8,17 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q3.3
|
||||
select c_city, s_city, d_year, sum(lo_revenue)
|
||||
as revenue
|
||||
from customer, supplier, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and (c_city='UNITED KI1'
|
||||
or c_city='UNITED KI5')
|
||||
and (s_city='UNITED KI1'
|
||||
or s_city='UNITED KI5')
|
||||
and d_year >= 1992 and d_year <= 1997
|
||||
group by c_city, s_city, d_year
|
||||
order by d_year asc, revenue desc;
|
||||
# Q3.3
|
||||
select c_city, s_city, d_year, sum(lo_revenue)
|
||||
as revenue
|
||||
from customer, supplier, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and (c_city='UNITED KI1'
|
||||
or c_city='UNITED KI5')
|
||||
and (s_city='UNITED KI1'
|
||||
or s_city='UNITED KI5')
|
||||
and d_year >= 1992 and d_year <= 1997
|
||||
group by c_city, s_city, d_year
|
||||
order by d_year asc, revenue desc;
|
||||
|
@ -8,18 +8,18 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q3.4
|
||||
select c_city, s_city, d_year, sum(lo_revenue)
|
||||
as revenue
|
||||
from dateinfo, customer,supplier, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and (c_city='UNITED KI1'
|
||||
or c_city='UNITED KI5')
|
||||
and (s_city='UNITED KI1'
|
||||
or s_city='UNITED KI5')
|
||||
and d_yearmonth = 'Dec1997'
|
||||
and lo_orderdate between 19971201 and 19971231 # added matching predicate
|
||||
group by c_city, s_city, d_year
|
||||
order by d_year asc, revenue desc, c_city, s_city;
|
||||
# Q3.4
|
||||
select c_city, s_city, d_year, sum(lo_revenue)
|
||||
as revenue
|
||||
from dateinfo, customer,supplier, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_orderdate = d_datekey
|
||||
and (c_city='UNITED KI1'
|
||||
or c_city='UNITED KI5')
|
||||
and (s_city='UNITED KI1'
|
||||
or s_city='UNITED KI5')
|
||||
and d_yearmonth = 'Dec1997'
|
||||
and lo_orderdate between 19971201 and 19971231 # added matching predicate
|
||||
group by c_city, s_city, d_year
|
||||
order by d_year asc, revenue desc, c_city, s_city;
|
||||
|
@ -8,17 +8,17 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q4.1
|
||||
select d_year, c_nation,
|
||||
sum(lo_revenue - lo_supplycost) as profit
|
||||
from customer, supplier, part, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_region = 'AMERICA'
|
||||
and s_region = 'AMERICA'
|
||||
and (p_mfgr = 'MFGR#1'
|
||||
or p_mfgr = 'MFGR#2')
|
||||
group by d_year, c_nation
|
||||
order by d_year, c_nation;
|
||||
# Q4.1
|
||||
select d_year, c_nation,
|
||||
sum(lo_revenue - lo_supplycost) as profit
|
||||
from customer, supplier, part, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_region = 'AMERICA'
|
||||
and s_region = 'AMERICA'
|
||||
and (p_mfgr = 'MFGR#1'
|
||||
or p_mfgr = 'MFGR#2')
|
||||
group by d_year, c_nation
|
||||
order by d_year, c_nation;
|
||||
|
@ -8,20 +8,20 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q4.2
|
||||
select d_year, s_nation, p_category,
|
||||
sum(lo_revenue - lo_supplycost) as profit
|
||||
from customer, supplier, part, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_region = 'AMERICA'
|
||||
and s_region = 'AMERICA'
|
||||
and (d_year = 1997 or d_year = 1998)
|
||||
and lo_orderdate between 19970101 and 19981231 # added matching predicate
|
||||
and (p_mfgr = 'MFGR#1'
|
||||
or p_mfgr = 'MFGR#2')
|
||||
group by d_year, s_nation, p_category
|
||||
order by d_year, s_nation, p_category;
|
||||
|
||||
# Q4.2
|
||||
select d_year, s_nation, p_category,
|
||||
sum(lo_revenue - lo_supplycost) as profit
|
||||
from customer, supplier, part, dateinfo, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_orderdate = d_datekey
|
||||
and c_region = 'AMERICA'
|
||||
and s_region = 'AMERICA'
|
||||
and (d_year = 1997 or d_year = 1998)
|
||||
and lo_orderdate between 19970101 and 19981231 # added matching predicate
|
||||
and (p_mfgr = 'MFGR#1'
|
||||
or p_mfgr = 'MFGR#2')
|
||||
group by d_year, s_nation, p_category
|
||||
order by d_year, s_nation, p_category;
|
||||
|
||||
|
@ -8,18 +8,18 @@
|
||||
-- source ../include/have_columnstore.inc
|
||||
|
||||
USE ssb1;
|
||||
# Q4.3
|
||||
select d_year, s_city, p_brand1,
|
||||
sum(lo_revenue - lo_supplycost) as profit
|
||||
from supplier, dateinfo, part, customer, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_orderdate = d_datekey
|
||||
and s_nation = 'UNITED STATES'
|
||||
and (d_year = 1997 or d_year = 1998)
|
||||
and lo_orderdate between 19970101 and 19981231 # added matching predicate
|
||||
and p_category = 'MFGR#14'
|
||||
group by d_year, s_city, p_brand1
|
||||
order by d_year, s_city, p_brand1;
|
||||
|
||||
# Q4.3
|
||||
select d_year, s_city, p_brand1,
|
||||
sum(lo_revenue - lo_supplycost) as profit
|
||||
from supplier, dateinfo, part, customer, lineorder # changed order
|
||||
where lo_custkey = c_custkey
|
||||
and lo_suppkey = s_suppkey
|
||||
and lo_partkey = p_partkey
|
||||
and lo_orderdate = d_datekey
|
||||
and s_nation = 'UNITED STATES'
|
||||
and (d_year = 1997 or d_year = 1998)
|
||||
and lo_orderdate between 19970101 and 19981231 # added matching predicate
|
||||
and p_category = 'MFGR#14'
|
||||
group by d_year, s_city, p_brand1
|
||||
order by d_year, s_city, p_brand1;
|
||||
|
||||
|
Reference in New Issue
Block a user