1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Dlee mtr restructure (#2494)

* Restructured test suites and added autopilot and extended suites

* Updated autopilot with correct branch - develop

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

* Fixed a path issue

* Updated some tests cases to keep up with development

Co-authored-by: root <root@rocky8.localdomain>
This commit is contained in:
Daniel Lee
2022-08-09 13:20:56 -05:00
committed by GitHub
parent 8b15e2f6a4
commit 4c9d6e39ac
6839 changed files with 10542409 additions and 77 deletions

View File

@ -0,0 +1,24 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug1632.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
#-- Self joins.
select n1.n_nationkey, n1.n_regionkey from nation n1, nation n2 where
n1.n_nationkey = n2.n_regionkey order by 1, 2;
select o1.o_orderkey o1order, o2.o_custkey o2order, o1.o_custkey
from orders o1,
orders o2
where o1.o_custkey = o2.o_orderkey and
o1.o_orderdate <= '1992-01-01' and
o1.o_orderstatus = 'F' and
o2.o_orderstatus = 'O'
order by 1, 2, 3;
#

View File

@ -0,0 +1,26 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug1796.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(n_nationkey)
from nation, customer, orders, lineitem
where n_nationkey = c_nationkey and
c_custkey = o_custkey and
o_orderkey = l_orderkey and
l_orderkey <= 10000;
select count(n_nationkey)
from nation, customer, orders, lineitem
where c_custkey = o_custkey and
o_orderkey = l_orderkey and
n_nationkey = c_nationkey and
l_orderkey <= 10000;
#

View File

@ -0,0 +1,20 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug1903.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
#-- Bug 1903. Test queries that do constant propagation optimization.
select n_regionkey, r_regionkey
from nation, region
where n_regionkey = r_regionkey and
r_regionkey = 3
order by 1, 2;
#

View File

@ -0,0 +1,28 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2549.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select sub5.c1 as sub5c1, sub1.c1 as sub1c1 from sub5 left join sub1 using (c1) order by 1;
select count(*) from sub5 left join sub1 using (c1);
select distinct sub5.c1 from sub5 left join sub1 using (c1) order by 1;
select sub5.s3 as sub5s3, sub2.s3 as sub2s3 from sub5 left join sub2 using (s3) where sub5.c1 <= 7 order by 1, 2;
select count(*) from sub5 left join sub2 using (s3) where sub5.c1 <= 7;
select sub5.s2, sub2.c2 from sub5 left join sub2 using (s3, s2) group by 1, 2 order by 1, 2;
select count(*) from sub5 right join sub1 using (c1);
select count(*) from sub5 left join sub1 on sub5.c3 = sub1.c3;
#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2577.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select sum((case when r_regionkey>3 or r_regionkey<1 then 1 else 0 end)*r_regionkey) alias from region;
select (case when (n_regionkey>3 and n_nationkey<5 or n_regionkey <2 and n_nationkey >7) then 1 else 0 end) alias from nation where n_nationkey < 10 order by 1;
#

View File

@ -0,0 +1,70 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2589.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select cidx, cbigint, round(cbigint) from datatypetestm;
select cidx, cbigint, round(cbigint,0) from datatypetestm;
select cidx, cbigint, round(cbigint,1) from datatypetestm;
select cidx, cbigint, round(cbigint,-1) from datatypetestm;
select cidx, cdecimal4_2, round(cdecimal4_2) from datatypetestm;
select cidx, cdecimal4_2, round(cdecimal4_2,2) from datatypetestm;
select cidx, cdecimal4_2, round(cdecimal4_2,0) from datatypetestm;
select cidx, cdecimal4_2, round(cdecimal4_2,-2) from datatypetestm;
select cidx, cdecimal18_2, round(cdecimal18_2,1) from datatypetestm;
select cidx, cdecimal18_2, round(cdecimal18_2,-1) from datatypetestm;
select cidx, cbigint from datatypetestm where round(cbigint) <> cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,1) <> cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,2) <> cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,0) <> cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,-2) <> cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,-1) <> cbigint;
select cidx, cbigint from datatypetestm where round(cbigint) = cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,1) = cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,2) = cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,0) = cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,-2) = cbigint;
select cidx, cbigint from datatypetestm where round(cbigint,-1) = cbigint;
select cidx, cdecimal4_2 from datatypetestm where round(cdecimal4_2,2) > cdecimal4_2;
select cidx, cdecimal4_2 from datatypetestm where round(cdecimal4_2,0) > cdecimal4_2;
select cidx, cdecimal4_2 from datatypetestm where round(cdecimal4_2,-1) > cdecimal4_2;
select cidx, cdecimal18_2 from datatypetestm where round(cdecimal18_2) < cdecimal18_2;
select cidx, cdecimal18_2 from datatypetestm where round(cdecimal18_2,1) < cdecimal18_2;
select cidx, cdecimal18_2 from datatypetestm where round(cdecimal18_2,2) < cdecimal18_2;
select cidx, cdecimal18_2 from datatypetestm where round(cdecimal18_2,0) < cdecimal18_2;
select cidx, cdecimal18_2 from datatypetestm where round(cdecimal18_2,-2) < cdecimal18_2;
select cidx, cdecimal18_2 from datatypetestm where round(cdecimal18_2,-1) < cdecimal18_2;
select round(r_regionkey, 0) from region;
select round(r_regionkey, -1) from region;
select round(r_regionkey, 1) from region;
select round(r_name, 2) from region;
select concat(n_name, round(n_nationkey, 0)) from nation;
select concat(n_name, round(n_nationkey, 1)) from nation;
select concat(n_name, round(n_nationkey, 2)) from nation;
select concat(n_name, round(n_nationkey, -1)) from nation;
select concat(n_name, round(n_nationkey, -2)) from nation;
select concat(n_name, round(n_nationkey/10, -1)) from nation;
select concat(n_name, round(n_nationkey/10, -2)) from nation;
select concat(n_name, round(n_nationkey/10, 1)) from nation;
select concat(n_name, round(n_nationkey/10, 2)) from nation;
select round(n_nationkey / n_regionkey - (n_nationkey * n_nationkey), 2) as rnd from nation, region where n_regionkey = r_regionkey order by 1;
select length(substr(n_name, round(n_nationkey / 10))) from nation;
select substr(cchar255, round(cdecimal1, 0),3) from datatypetestm where length(cchar255) > 5;
#

View File

@ -0,0 +1,17 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2595.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
##-- Bug 2595 regression test.
select c2 from sub1 order by 1;
select c2 from sub2 order by 1;
select sub1.c2 as x, sub1.c2 as y from sub1, sub2 where sub1.c2 = sub2.c2 order by 1, 2;
select sub1.c2 as x, sub2.c2 as y, count(sub2.c2) as z from sub1, sub2 where sub1.c2 = sub2.c2 group by 1, 2 order by 1, 2;
#

View File

@ -0,0 +1,25 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2657.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
SELECT n_nationkey, n_name as c1 FROM nation group by n_nationkey,
n_name order by substr(n_nationkey,1,2);
SELECT n_nationkey as c0, n_name as c1 FROM nation group by
n_nationkey, n_name order by isnull(n_nationkey), n_nationkey;
SELECT n_nationkey as c0, n_name as c1 FROM nation group by
n_nationkey, n_name order by isnull(n_name), n_name;
SELECT n_nationkey as c0, n_name as c1 FROM nation group by n_nationkey,
n_name order by substr(n_nationkey,1,2);
select cchar8, cvchar6 from datatypetestm order by isnull(cchar8), cchar8;
#

View File

@ -0,0 +1,18 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2712.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
#-- group by counter
select abs(n_regionkey+n_nationkey), count(*) from nation group by 1 order by 1;
#-- group by alias
select abs(n_regionkey+n_nationkey) a, count(*) from nation group by a order by 1;
#-- group by FE
select abs(n_regionkey+n_nationkey) a, count(*) from nation group by abs(n_regionkey+n_nationkey) order by 1;
select abs(n_regionkey+n_nationkey) a, count(*) from nation group by 1, abs(n_nationkey+n_regionkey) order by 1;#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2732.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select n_name from nation where locate('A', n_name, 4) > 0 order by 1;
select n_name from nation where locate('A', n_name) > 0 order by 1;
#

View File

@ -0,0 +1,28 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2741.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
set autocommit=0;
select count(*) from nation where n_nationkey * (n_regionkey > 0) = 0;
select count(*) from nation where n_nationkey * (n_regionkey > 0) = 0;
select count(*) from nation where n_nationkey * (n_regionkey > 0) = 0;
select count(*) from nation where n_nationkey * (n_regionkey > 2) = 0;
select count(*) from nation where n_nationkey * (n_regionkey > 2) = 0;
select count(*) from nation where n_nationkey * (n_regionkey > 2) = 0;
update nation set n_regionkey = n_nationkey where n_nationkey * (n_regionkey > 0) = 0;
select count(*) from nation where n_nationkey * (n_regionkey > 0) = 0;
select * from nation;
rollback;
update nation set n_regionkey = n_nationkey where n_nationkey * (n_regionkey > 2) = 0;
select count(*) from nation where n_nationkey * (n_regionkey > 2) = 0;
select * from nation;
rollback;
#

View File

@ -0,0 +1,21 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2762.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(*) from orders where o_orderstatus = 'F';
select count(*) from orders where o_orderstatus like 'F%';
select count(*) from orders where o_orderstatus <> 'F';
select count(*) from orders where o_orderstatus not like 'F%';
select count(*) from orders where o_orderstatus = 'F' or o_orderstatus = 'O';
select count(*) from orders where o_orderstatus like 'F%' or o_orderstatus like 'O%';
select count(*) from orders where o_orderpriority like '4-NOT SPECIFIED';
select count(*) from orders where o_orderpriority = '4-NOT SPECIFIED';
select count(*) from orders where o_orderpriority like '4-%';
#

View File

@ -0,0 +1,15 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2788.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists foo;
create table foo (col1 int(11) null default null) engine=columnstore;
drop table foo;
#

View File

@ -0,0 +1,20 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2810.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select 'q1', sub1.* from sub1 where c1 not in (select c1 from sub2 where sub1.c3 =
sub2.c3) order by 1, 2, 3;
select 'q2', c1,c3,c2 from sub1 where (c1,c3) not in (select c1,c3 from sub2 where sub1.c2 = sub2.c2) order by 1, 2, 3;
#select 'q3', c1,c3 from sub1 where (c1,c3) not in (select c1,c3 from sub2) order by 1, 2, 3;
select 'q4', c1 from sub1 where c1 not in (select c2 from sub2) order by 1, 2;
#

View File

@ -0,0 +1,22 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2813.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select distinct(d_sellingseason) from dateinfo where d_sellingseason like 'F%' order by 1;
select distinct(d_sellingseason) from dateinfo where d_sellingseason like 'F%' or d_sellingseason like 'W%' order by 1;
select distinct(d_sellingseason) from dateinfo where d_sellingseason like '%r' order by 1;
select distinct(d_sellingseason) from dateinfo where d_sellingseason like '%r' or d_sellingseason like '%r' order by 1;
select distinct(d_sellingseason) from dateinfo where d_sellingseason like '%r' or d_sellingseason like '%g' order by 1;
#

View File

@ -0,0 +1,18 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2835.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug2835;
create table bug2835 (c1 int, c2 varchar(6), c3 varchar(20), c4 datetime)engine=columnstore;
insert into bug2835 values (1, 'one', 'one', '2010-01-01'), (2, 'two', 'two', '2010-02-02'), (null, null, null, null);
select c1, c2, c3, ifnull(c1,"z"), ifnull(c2,''), ifnull(c3,''), ifnull(c4,'') from bug2835;
drop table bug2835;
#

View File

@ -0,0 +1,30 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2838.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select count(*), d1.d_date
from dateinfo as d1
inner join lineorder l1 on l1.lo_orderdate = d1.d_datekey
inner join lineorder l2 on l2.lo_orderkey = l1.lo_orderkey
where l1.lo_orderkey < 10 and l2.lo_orderkey < 10 and
l1.lo_linenumber <= l2.lo_linenumber
group by d1.d_date
order by d1.d_date;
select count(*), d1.d_date
from dateinfo as d1
inner join lineorder l1 on l1.lo_orderdate = d1.d_datekey
inner join lineorder l2 on l2.lo_orderkey = l1.lo_orderkey and
l1.lo_linenumber <= l2.lo_linenumber
where l1.lo_orderkey < 10 and l2.lo_orderkey < 10
group by d1.d_date
order by d1.d_date;
#

View File

@ -0,0 +1,22 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2845.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug2845;
create table bug2845(c1 int, c2 varchar(7), c3 varchar(30))engine=columnstore;
insert into bug2845 values (1, 'A\'s', 'Joe\'s');
select * from bug2845;
update bug2845 set c2='Bubba\'s', c3='Uncle Julio\'s';
select * from bug2845;
delete from bug2845;
select count(*) from bug2845;
drop table bug2845;
#

View File

@ -0,0 +1,37 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2873.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug2873;
create table bug2873(id int, logtime int, filename varchar(20))engine=columnstore;
insert into bug2873 values
(1, unix_timestamp('2010-05-23 10:00:10'), 'Cam1.jpg'),
(1, unix_timestamp('2010-05-23 10:00:12'), 'Cam1.jpg23'),
(1, unix_timestamp('2010-05-23 10:00:15'), 'LLCam1.jpg'),
(1, unix_timestamp('2010-05-23 10:00:18'), 'EECam1.jpg'),
(1, unix_timestamp('2010-05-23 10:00:19'), 'Hey.jpg'),
(1, unix_timestamp('2010-05-23 10:20:30'), 'Cam11.jpg'),
(1, unix_timestamp('2010-05-23 10:22:10'), 'Cam12.jpg'),
(1, unix_timestamp('2010-05-23 10:25:40'), 'ICam1.jpg'),
(1, unix_timestamp('2010-05-23 10:49:12'), 'Cam1.jpg2'),
(1, unix_timestamp('2010-05-23 10:50:10'), 'Cam15.jpg'),
(1, unix_timestamp('2010-05-23 10:51:10'), 'Cam1.jpg');
set @maxi=(select max(logtime) from bug2873);
select if(filename like 'Cam1.jpg',filename ,'no') datei , count(*)
cnt from bug2873 where logtime > @maxi-3600 group by 1 having datei != 'no';
select if(filename rlike '^Cam1.jpg$',filename ,'no') datei from bug2873 limit 1;
select if(filename rlike '^Cam1.jpg$',filename ,'no') datei from bug2873;
select if(filename rlike '^Cam1.jpg$',filename ,'no') datei from bug2873 where if(filename rlike '^Cam1.jpg$',filename ,'no')='no' limit 1;
drop table bug2873;
#

View File

@ -0,0 +1,25 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2876.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug2876;
create table bug2876(c1 int, c2 varchar(117))engine=columnstore;
insert into bug2876 values (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3);
insert into bug2876 values (1, null), (2, null), (3, null), (null, 1), (null, 2), (null, 3), (null, null);
select * from bug2876 where c1 = c2 order by 1, 2;
select * from bug2876 where c1 != c2 order by 1, 2;
select * from bug2876 where c1 < c2 order by 1, 2;
select * from bug2876 where c1 > c2 order by 1, 2;
select * from bug2876 where c1 <= c2 order by 1, 2;
select * from bug2876 where c1 >= c2 order by 1, 2;
delete from bug2876 where c1 = c2;
select * from bug2876 order by 1, 2;
drop table bug2876;
#

View File

@ -0,0 +1,17 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2884.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select count(*) from dateinfo where d_datekey in (select d_datekey from dateinfo);
select count(*) from dateinfo where d_datekey not in (select d_datekey from dateinfo);
select count(*) from dateinfo where d_month in (select d_month from dateinfo);
select count(*) from dateinfo where d_sellingseason in (select d_sellingseason from dateinfo);
#

View File

@ -0,0 +1,16 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2892.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select cdatetime, year(cdatetime), week(cdatetime) from datatypetestm group by 1, 2, 3 order by 1;
select cdatetime, week(cdatetime) from datatypetestm group by 1, 2 order by 1;
select cdatetime, year(cdatetime) from datatypetestm group by 1, 2 order by 1;
#

View File

@ -0,0 +1,13 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2907.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select lo_shipmode, c_region, sum(lo_extendedprice), count(*) from lineorder join customer on lo_custkey = c_custkey where lo_orderdate between (select d_start from ( select d_yearmonthnum * 100 + 1 d_start , count(*) from dateinfo where d_weekdayfl = 1 and d_year = 1998 group by 1 order by 2 desc limit 1) alias1) and (select d_end from ( select d_yearmonthnum * 100 + 31 d_end , count(*) from dateinfo where d_weekdayfl = 1 and d_year = 1998 group by 1 order by 2 desc limit 1) alias2) group by 1,2 order by 1,2;
#

View File

@ -0,0 +1,16 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2909.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select customer.* from lineorder join customer on lo_custkey = c_custkey where lo_orderdate between
19970101 and 19971230 and lo_custkey = ( select lo_custkey from (select lo_custkey,
sum(lo_extendedprice) from lineorder where lo_orderdate between 19971201 and 19971230 group by 1 order by 2 desc
limit 1 ) a );
#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2911_negative.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
# WWW 6/2/2010. No longer a negative test case courtesy of DHill implementing the mod function.
select count(*)%25 from nation;
#

View File

@ -0,0 +1,15 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2912.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select if(count(r_regionkey)/15000=round(count(r_regionkey)*15000),"good","bad") alias from region;
select if(count(o_orderkey)/15000=round(count(o_orderkey)*15000/15000/15000),"good","bad") alias2 from orders;
#

View File

@ -0,0 +1,38 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2915.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists tbl1;
drop table if exists tbl2;
create table tbl1 (c1 char(1), c2 char(255))engine=columnstore;
create table tbl2 (c1 char(1), c2 char(255))engine=columnstore;
insert into tbl1 values (1, 1), (2, 2), (3, 3), (4, 4), (null, null);
insert into tbl2 values (1, 1), (2, 2), (3, 3), (null, null);
select count(*) from tbl1 join tbl2 on tbl1.c1 = tbl2.c1;
select count(*) from tbl1 join tbl2 on tbl1.c1 = tbl2.c2;
select count(*) from tbl1 join tbl2 on tbl1.c2 = tbl2.c1;
select count(*) from tbl1 join tbl2 on tbl1.c2 = tbl2.c2;
select count(*) from tbl1 left join tbl2 on tbl1.c1 = tbl2.c1;
select count(*) from tbl1 left join tbl2 on tbl1.c1 = tbl2.c2;
select count(*) from tbl1 left join tbl2 on tbl1.c2 = tbl2.c1;
select count(*) from tbl1 left join tbl2 on tbl1.c2 = tbl2.c2;
select count(*) from tbl1 right join tbl2 on tbl1.c1 = tbl2.c1;
select count(*) from tbl1 right join tbl2 on tbl1.c1 = tbl2.c2;
select count(*) from tbl1 right join tbl2 on tbl1.c2 = tbl2.c1;
select count(*) from tbl1 right join tbl2 on tbl1.c2 = tbl2.c2;
drop table tbl1;
drop table tbl2;
#

View File

@ -0,0 +1,12 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2919.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select col1%75000 from (select count(r_regionkey) col1 from region) xxx;#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2922.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select c_name, d_month, sum(lo_extendedprice), min(lo_orderdate), max(lo_orderdate) from lineorder join customer on lo_custkey = c_custkey join dateinfo on lo_orderdate = d_datekey where lo_orderdate between 19970101 and 19971230 and lo_custkey in ( select lo_custkey from (select lo_custkey, sum(lo_extendedprice) from lineorder where lo_orderdate between 19971201 and 19971230 group by 1 order by 2 desc limit 10 ) a ) group by 1,2 order by 1,2;
select count(*) from lineorder where lo_orderdate between 19970101 and 19970105 and lo_custkey not in ( select lo_custkey from (select lo_custkey from lineorder where lo_orderdate between 19971201 and 19971201 ) a );
#

View File

@ -0,0 +1,13 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2924.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select count(*) from lineorder alias1 join customer on lo_custkey = c_custkey where lo_orderdate between 19970101 and 19971230 and exists ( select 'x' from (select lo_custkey, sum(lo_extendedprice) from lineorder where lo_orderdate between 19971201 and 19971230 group by 1 order by 2 desc limit 100 ) a where a.lo_custkey = alias1.lo_orderkey );
#

View File

@ -0,0 +1,13 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2928.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(1+1) from nation;
#

View File

@ -0,0 +1,13 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2932.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(*) from region a inner join nation b on (a.r_regionkey=b.n_regionkey) right outer join customer c on (b.n_name and b.n_nationkey = c.c_nationkey);
select * from region where r_regionkey; #

View File

@ -0,0 +1,18 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2938.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select t.CCHAR1 from datatypetestm t, (select CCHAR1 from datatypetestm1) t1 where t.CCHAR1 = t1.CCHAR1 order by 1;
select t.CCHAR9 from datatypetestm t, (select CCHAR9 from datatypetestm1) t1 where t.CCHAR9 = t1.CCHAR9 order by 1;
select t.CCHAR1 from datatypetestm t, (select CCHAR9 from datatypetestm1) t1 where t.CCHAR1 = t1.CCHAR9 order by 1;
select t1.CCHAR1 from datatypetestm t1, (select t2.CCHAR1 from datatypetestm t2) t3 where t1.CCHAR1 = t3.CCHAR1 order by 1;
select t1.CCHAR1 from datatypetestm t1, (select t2.CCHAR9 from datatypetestm t2) t3 where t1.CCHAR1 = t3.CCHAR9 order by 1;
#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2954.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select cidx, abs(ROUND(COT(cidx),2)) from datatypetestm order by 1;
#

View File

@ -0,0 +1,27 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2961.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
/* From bug 2961 description. */
select top_part.n_nationkey top, minus_part.n_nationkey minus from (select n_nationkey from nation)
top_part left outer join (select n_nationkey from nation) minus_part on ( top_part.n_nationkey = minus_part.n_nationkey ) order by 1, 2;
select top_part.n_nationkey top, minus_part.n_nationkey minus from (select n_nationkey from nation) top_part left outer join
(select n_nationkey from nation where n_nationkey < 5) minus_part on (top_part.n_nationkey = minus_part.n_nationkey ) order by 1, 2;
/* Comment 1 */
select sub1.c1 x, sub2.c1 y from sub1 left join sub2 on sub1.c1 = sub2.c1 order by 1, 2;
select sub1.c1, x.c1 from sub1 left join (select c1 from sub2) x on sub1.c1 = x.c1 order by 1, 2;
/* Comment 3 */
select sub1.c1, x.c1 from sub1 join (select sub1.c1 as sub1_c1, sub2.c1 from sub1 left join sub2 on
sub1.c1 = sub2.c1) x on sub1.c1 = x.sub1_c1 order by 1, 2;
#

View File

@ -0,0 +1,193 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2976.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
/*
* Bug 2976. Lost connection with from clause subselect against MyISAM tables in an InfiniDB instance.
*/
drop table if exists a;
drop table if exists b;
create table a (c1 int)engine=myisam;
create table b (c2 int)engine=myisam;
insert into a values (1), (2);
insert into b values (1), (2);
select * from a, (select * from b) x;
drop table a;
drop table b;
/*
* Skinit example.
*/
drop table if exists shipamounts;
drop table if exists ship1;
drop table if exists ship2;
CREATE TABLE `shipamounts` (
`OrderNum` varchar(50) DEFAULT NULL,
`OrderLine` int(11) DEFAULT NULL,
`ShippingAmount` decimal(10,2) DEFAULT NULL,
`ShippingDiscountAmount` decimal(10,2) DEFAULT NULL,
`ShippingOrderAmount` decimal(10,2) DEFAULT NULL,
`ShippingDiscountOrderAmount` decimal(10,2) DEFAULT NULL
) ENGINE=myisam DEFAULT CHARSET=latin1;
CREATE TABLE `ship1` (
`OrderNum` varchar(50) DEFAULT NULL,
`OrderLine` int(11) DEFAULT NULL,
`ShippingAmount` decimal(10,2) DEFAULT NULL,
`ShippingOrderAmount` decimal(10,2) DEFAULT NULL,
`ShippingDiscountAmount` decimal(10,2) DEFAULT NULL,
`ShippingDiscountOrderAmount` decimal(10,2) DEFAULT NULL
) ENGINE=myisam DEFAULT CHARSET=latin1;
CREATE TABLE `ship2` (
`OrderNum` varchar(50) DEFAULT NULL,
`OrderLine` int(11) DEFAULT NULL,
`ShippingAmount` decimal(10,2) DEFAULT NULL,
`ShippingOrderAmount` decimal(10,2) DEFAULT NULL,
`ShippingDiscountAmount` decimal(10,2) DEFAULT NULL,
`ShippingDiscountOrderAmount` decimal(10,2) DEFAULT NULL
) ENGINE=myisam DEFAULT CHARSET=latin1;
insert into shipamounts values (2357203684, 352338, 0, 0, 0, 0);
insert into ship1 values (2357203684, 352338, 0, 0, 0, 0);
insert into ship2 values (2357203684, 352338, 0, 0, 0, 0);
SELECT s.OrderNum, s.OrderLine, s.ShippingAmount, s.ShippingOrderAmount,
total.ShippingTotalAmount, s.ShippingDiscountAmount,
s.ShippingDiscountOrderAmount,
total.ShippingDiscountTotalAmount,
IF( s.OrderLine = t.MinOrderLine, 1, 0 )
FROM shipAmounts AS s
LEFT OUTER JOIN (
SELECT OrderNum, MIN(OrderLine) AS MinOrderLine
FROM ship1
GROUP BY OrderNum
) AS t ON s.OrderNum = t.OrderNum
LEFT OUTER JOIN (
SELECT OrderNum, SUM(ShippingAmount) AS ShippingTotalAmount,
SUM(ShippingDiscountAmount) AS ShippingDiscountTotalAmount
FROM ship2 GROUP BY OrderNum
) AS total ON s.OrderNum = total.OrderNum;
SELECT s.OrderNum, s.OrderLine, s.ShippingAmount, s.ShippingOrderAmount,
total.ShippingTotalAmount, s.ShippingDiscountAmount,
s.ShippingDiscountOrderAmount,
total.ShippingDiscountTotalAmount,
IF( s.OrderLine = t.MinOrderLine, 1, 0 )
FROM shipAmounts AS s
JOIN (
SELECT sa.OrderNum, MIN(ship1.OrderLine) AS MinOrderLine
FROM shipAmounts sa left join ship1
on (sa.OrderNum = ship1.OrderNum)
GROUP BY OrderNum
) AS t ON s.OrderNum = t.OrderNum
LEFT OUTER JOIN (
SELECT OrderNum, SUM(ShippingAmount) AS ShippingTotalAmount,
SUM(ShippingDiscountAmount) AS ShippingDiscountTotalAmount
FROM ship2 GROUP BY OrderNum
) AS total ON s.OrderNum = total.OrderNum;
drop table if exists shipamounts;
drop table if exists ship1;
drop table if exists ship2;
/*
* Lurn India example.
*/
drop table if exists users;
drop table if exists user_login_log;
drop table if exists user_groups;
drop table if exists user_types;
drop table if exists system;
drop table if exists user_system;
create table users(
id int,
users_id int,
fullname varchar(40),
email varchar(40),
countries_name varchar(40),
state_name varchar(7),
tel_no varchar(12),
affiliate_id varchar(30),
created datetime,
milestone varchar(20),
tel_no2 varchar(12),
class int,
status varchar(20)
)engine=myisam;
create table user_login_log
(
user_id int,
dw_system_id int,
login_time datetime
)engine=myisam;
create table user_groups
(
user_id int,
status varchar(7),
start_date date,
end_date date,
user_type_id int
)engine=myisam;
create table user_types
(
id int,
user_type_id int,
name varchar(20)
)engine=myisam;
create table user_system
(
user_id int,
system_id int
)engine=myisam;
create table system
(
id int,
dw_system_id int
)engine=myisam;
SELECT u.users_id as user_id, u.fullname as fullname, u.email as email, u.countries_name as country, u.state_name as state, COALESCE(tel_no, tel_no2, 'No Number') as contact,
IFNULL((SELECT users.fullname FROM users WHERE users.id = affiliate_id), 'No Affiliate') as affiliate_name,
IFNULL((SELECT users.email FROM users WHERE users.id = affiliate_id), 'No Affiliate') as affiliate_email,
DATE_FORMAT( ug.start_date, '%W %D, %M %Y' ) as start_date, DATE_FORMAT( ug.end_date, '%W %D, %M %Y' ) as end_date, ug.status AS status , ug.name AS product, DATE_FORMAT( u.created, '%W %D, %M %Y' ) as created,
(SELECT DATE_FORMAT( max(ull.login_time), '%W %D, %M %Y' ) FROM user_login_log as ull WHERE ull.user_id = ug.user_id AND ull.dw_system_id = (SELECT dw_system_id from system where id = 6) AND ull.login_time BETWEEN '2010-06-01' AND '2010-06-30') as 'Last Log In',
(SELECT count(id) FROM user_login_log as ull WHERE ull.user_id = ug.user_id AND ull.dw_system_id = (SELECT dw_system_id from system where id = 6) AND ull.login_time BETWEEN '2010-06-01' AND '2010-06-30') as login_count,
u.milestone as milestone_level,
u.class as class_level
FROM users u, (
SELECT user_id, user_groups.user_type_id, start_date, end_date, user_groups.status, user_types.name
FROM user_groups, user_types
WHERE user_types.user_type_id IN (54)
AND user_groups.user_type_id = user_types.id
AND user_groups.status IN ('active')
GROUP BY user_id
ORDER BY user_type_id DESC ) ug, user_system as us
WHERE ug.user_id = u.id
AND u.id = us.user_id
AND us.system_id IN (6)
AND u.status IN ('active')
AND ug.start_date BETWEEN '2010-06-01' AND '2010-06-30'
ORDER BY DATE(ug.start_date) DESC, u.users_id DESC;
drop table if exists users;
drop table if exists user_login_log;
drop table if exists user_groups;
drop table if exists user_types;
drop table if exists system;
drop table if exists user_system;
#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug2992.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select cidx, cbigint, avg(cbigint) from datatypetestm group by cidx, cbigint order by 1;
select avg(cbigint) from datatypetestm where cidx=1;
#

View File

@ -0,0 +1,16 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3002.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select * from (select l_orderkey from lineitem where l_orderkey <= 10) x order by 1;
#-- make sure session is not hung after above query
select * from region;
#

View File

@ -0,0 +1,26 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3003.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
SELECT
`LOGICAL_TABLE_1`.`p_name` AS `COL0`,
`LOGICAL_TABLE_1`.`p_size` AS `COL1`
FROM
(select * from part where p_partkey < 20 limit 10) `LOGICAL_TABLE_1`
ORDER BY `COL0`, `COL1`;
SELECT
`LOGICAL_TABLE_1`.`p_name` AS `COL0`,
`LOGICAL_TABLE_1`.`p_size` AS `COL1`
FROM
(select * from part where p_partkey < 20 limit 10) `LOGICAL_TABLE_1`
ORDER BY COL0, COL1;
#

View File

@ -0,0 +1,21 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3007.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
create database if not exists bug3007;
drop table if exists bug3007.bug;
create table bug3007.bug(c1 int)engine=columnstore;
insert into bug3007.bug values (1), (2);
select * from bug3007.bug;
update bug3007.bug set c1=99;
delete from bug3007.bug;
drop table if exists bug3007.bug;
drop database if exists bug3007;
#

View File

@ -0,0 +1,22 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3012.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3012;
create table bug3012 (anz int, mx varchar(20)) engine=columnstore;
insert into bug3012 values (1,'hotmail.com'), (2,'hotmail.com'), (3,'foo.com'),
(4,'www.1and1.net'), (5,'1and1.com');
select * from bug3012;
SELECT * FROM bug3012 WHERE (mx RLIKE 'hotmail' OR mx RLIKE '1and1');
SELECT * FROM bug3012 WHERE (mx RLIKE '1and1' OR mx RLIKE 'hotmail');
drop table if exists bug3012;
#

View File

@ -0,0 +1,27 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3019.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select lo_supplycost
from lineorder
where lo_partkey < 3400 and lo_suppkey < 90 and lo_discount/lo_tax < 1.4 and
lo_supplycost in
(select col1
from ( select lo_supplycost col1, count(*) cnt
from lineorder
where lo_partkey < 3400 and lo_suppkey < 90 and lo_discount/lo_tax < 1.4
group by 1
having cnt > 2
order by cnt desc limit 100) a)
order by 1;
select count(*) from dateinfo where d_datekey in ( select d_datekey from
(select d_datekey from dateinfo group by 1 order by count(*) desc limit 10) a);
#

View File

@ -0,0 +1,23 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3021.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select date('2010-02-01') into @xxx;
select @xxx;
drop table if exists bug3021;
create table bug3021(c1 date)engine=columnstore;
insert into bug3021 values ('2001-01-01');
update bug3021 set c1=@xxx;
select * from bug3021;
update bug3021 set c1=date('2010-11-14');
select * from bug3021;
drop table bug3021;
#

View File

@ -0,0 +1,23 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3024.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select * from nation where n_nationkey=@value;
set @value=5;
select * from nation where n_nationkey=@value;
create table if not exists bug3024 (c1 int) engine=columnstore;
insert into bug3024 values (1), (2);
update bug3024 set c1=3 where c1=@value;
set @value=2;
update bug3024 set c1=3 where c1=@value;
select * from bug3024;
drop table if exists bug3024;
#

View File

@ -0,0 +1,43 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3025.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3025;
create table bug3025(value integer(5)) engine=Columnstore;
insert into bug3025 values (1), (1001), (24), (2123), (null), (123), (888), (8421), (231), (-100), (null);
select value, IF(value<=1000,'<=1000', '>1000')
from bug3025
group by value, IF(value<=1000,'<=1000', '>1000')
order by ISNULL(IF(value<=1000,'<=1000', '>1000')), value;
select IF(value<=1000,'<=1000', '>1000')
from bug3025
group by IF(value<=1000,'<=1000', '>1000'), value
order by ISNULL(IF(value<=1000,'<=1000', '>1000')), value;
select IF(value<=1000,'<=1000', '>1000') from bug3025 group by
IF(value<=1000,'<=1000', '>1000') order by IF(value<=1000,'<=1000', '>1000');
select IF(value<=1000,'<=1000', '>1000') a, isnull(IF(value<=1000,'<=1000',
'>1000')) b from bug3025 group by 1,2 order by 2,1;
select * from (select count(*) cnt , if((if(not isnull(value),"notNull","null")
like 'null'),null,if(value<1000,"<1000",">=1000")) a from bug3025 group by a, value
order by not isnull(a),2 asc) b
order by 1, 2;
select IF(value<=1000,'<=1000', '>1000') a, isnull(IF(value<=1000,'<=1000', '>1000')) b from bug3025 group by 1,2 order by 2,1;
drop table if exists bug3025;
#

View File

@ -0,0 +1,36 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3051.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3051;
CREATE TABLE `bug3051` (
`c1` int(11) DEFAULT NULL,
`c2` varchar(17) DEFAULT NULL,
`c3` tinyint(3) DEFAULT NULL,
`c4` varchar(20) DEFAULT NULL,
`c5` varchar(20) DEFAULT NULL,
`c6` varchar(15) DEFAULT NULL,
`c7` datetime DEFAULT NULL,
`c8` int(11) DEFAULT NULL,
`c9` varchar(50) DEFAULT NULL,
`c10` varchar(20) DEFAULT NULL,
`c11` varchar(255) DEFAULT NULL,
`c12` varchar(4096) DEFAULT NULL,
`c14` int(11) DEFAULT NULL
) engine=columnstore DEFAULT CHARSET=latin1;
insert into bug3051 values (1,1,1,1,1,1,now(),1,1,1,1,1,1);
insert into bug3051 values (2,2,2,2,2,2,now(),2,2,2,2,2,2);
alter table bug3051 drop column c7;
alter table bug3051 add column c7 datetime;
select count(*) from bug3051;
update bug3051 set c7=now();
drop table bug3051;
#

View File

@ -0,0 +1,23 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3058.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(*) from nation where n_nationkey in (select n_nationkey from (select n_nationkey from nation group by n_nationkey ) a);
select count(*) from nation where n_nationkey in (select n_nationkey from (select count(*) c3, n_nationkey from nation group by n_nationkey ) a);
select count(*) from nation where n_nationkey in (select n_nationkey from (select n_nationkey, count(*) from nation group by n_nationkey ) a);
select n_nationkey from (select count(*) c3, n_nationkey from nation group by 2) a order by 1;
select n_nationkey, n_name from nation where n_nationkey in (select r_regionkey from (select count(*), r_regionkey from region group by 2) a) order by 1;
select n_nationkey, n_name from nation where n_nationkey in (select r_regionkey from (select r_regionkey, count(*) from region group by 1) a) order by 1;
#

View File

@ -0,0 +1,24 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3067.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select * from (
select F, count(*) from (select count(*) F from lineorder where
lo_orderdate between 19940101 and 19940110 and lo_quantity <= 20
group
by lo_quantity ) a group by F union all
select F, count(*) from (select count(*) F from lineorder where
lo_orderdate between 19940101 and 19940110 and lo_quantity between 21 and 40
group
by lo_quantity ) a group by F) a
order by 1, 2;
#

View File

@ -0,0 +1,26 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3076.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(*), o_orderstatus from orders group by o_orderstatus order by count(*) desc, 2;
select count(*), o_orderstatus from orders group by o_orderstatus order by 1 desc, 2;
select count(*) cnt, o_orderstatus from orders group by o_orderstatus order by cnt desc, 2;
select count(o_orderstatus), o_orderstatus from orders group by o_orderstatus order by count(o_orderstatus) desc, 2;
select count(o_orderstatus), o_orderstatus from orders group by o_orderstatus order by 1, 2 desc;
select count(distinct o_orderstatus), o_orderstatus from orders group by o_orderstatus order by 1, 2 desc;
select count(distinct o_orderstatus), o_orderstatus from orders group by o_orderstatus order by count(distinct o_orderstatus), 2 desc;
#

View File

@ -0,0 +1,22 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3129.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
set autocommit=0;
select * from region where r_regionkey=1;
update region set r_comment='xxx' where r_regionkey=1;
select * from region where r_regionkey=1;
rollback;
select * from region where r_regionkey=1;
update region set r_comment='xxx' where r_regionkey=1;
select * from region where r_regionkey=1;
rollback;
select * from region where r_regionkey=1;
#

View File

@ -0,0 +1,33 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3137.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3137;
CREATE TABLE `bug3137` (
`id` INTEGER DEFAULT NULL,
`value` INTEGER DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8;
INSERT INTO `bug3137` (id, value) VALUES (0, 1);
INSERT INTO `bug3137` (id, value) VALUES (1, 1);
INSERT INTO `bug3137` (id, value) VALUES (2, 2);
INSERT INTO `bug3137` (id, value) VALUES (3, 2);
INSERT INTO `bug3137` (id, value) VALUES (4, 3);
INSERT INTO `bug3137` (id, value) VALUES (5, 3);
select * from bug3137 where (value = 1 OR 1 = 1);
select * from bug3137 where id >= 0 and (value = 1 or 1 = -1);
select n_nationkey from nation where n_nationkey <=5 and (n_nationkey=2 or 1=-1);
drop table if exists bug3137;
#

View File

@ -0,0 +1,35 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3167.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select n_name from ((select n_name, n_regionkey from nation) union all
(select n_name, n_regionkey from nation)) as a order by 1;
select n_name from ((select n_name, n_regionkey from nation) union
(select n_name, n_regionkey from nation)) as a order by 1;
select a_name from ((select n_name as a_name from nation) union (select
n_name as a_name from nation)) as a order by 1;
select name1 from ((select n_name as name1, n_regionkey from nation)
union all (select n_name as name1, n_regionkey from nation)) as a order by 1;
select a.a_name, a.regionkey from ((select n_name as a_name, n_regionkey
as regionkey from nation) union (select n_name as a_name, n_regionkey as
regionkey from nation)) as a order by 1, 2;
select a_name from ((select n_name as a_name from nation) union all (select
n_name as a_name from nation)) as a order by 1;
select a.a_name, a.regionkey from ((select n_name as a_name, n_regionkey
as regionkey from nation) union all (select n_name as a_name, n_regionkey as
regionkey from nation)) as a order by 1, 2;
#

View File

@ -0,0 +1,40 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3181.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select r_regionkey, r_name,
sum(ordercnt2) ordercnt3,
round(sum(sumcusttotal2)/100,2) custtotal3,
min(minorderdate2) minorderdate3,
max(maxorderdate2) maxorderdate3
from region,
(select n_nationkey,
n_regionkey,
sum(ordercnt1) ordercnt2,
sum(totalprice1) sumcusttotal2,
min(minorderdate1) minorderdate2,
max(maxorderdate1) maxorderdate2
from customer, nation,
(select o_custkey,
count(*) ordercnt1,
sum(o_totalprice)*100 totalprice1,
min(o_orderdate) minorderdate1,
max(o_orderdate) maxorderdate1
from orders group by o_custkey) order1
where c_custkey = o_custkey
and c_nationkey = n_nationkey
group by n_nationkey, n_regionkey
) nation1
where r_regionkey = n_regionkey
group by r_regionkey, r_name
order by r_regionkey, r_name;
#

View File

@ -0,0 +1,13 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3193.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select * from sub1 LEFT OUTER JOIN (select * from sub2) Meal on(sub1.c1=Meal.c1 and sub1.c2=Meal.c2) order by 1;
#

View File

@ -0,0 +1,16 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3194.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select * from sub1 left outer join (select * from sub2)a on (sub1.c1=a.c1 and sub1.c2=a.c2) order by 1,2, 3, 4, 5, 6, 7, 8, 9, 10;
select * from sub1 right outer join (select * from sub2)a on (sub1.c1=a.c1 and sub1.c2=a.c2) order by 1,2, 3, 4, 5, 6, 7, 8, 9, 10;
select * from sub1 left outer join (select * from sub2)a using(c1,c2) order by 1,2, 3, 4, 5, 6, 7, 8, 9, 10;
select * from sub1 right outer join (select * from sub2)a using(c1,c2) order by 1,2, 3, 4, 5, 6, 7, 8, 9, 10;
#

View File

@ -0,0 +1,16 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3203.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3203;
create table bug3203 (c1 varchar(20))engine=columnstore;
select * from bug3203 where c1 = 'x';
drop table if exists bug3203;
#

View File

@ -0,0 +1,50 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3229.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists testnulldate;
create table testnulldate (id int, time_stamp datetime) engine=columnstore;
insert into testnulldate values (1, '2010-11-08 17:46:44');
insert into testnulldate values (2, null);
insert into testnulldate values (3, SUBDATE('2010-11-08 17:46:44', 1));
select
id,
`time_stamp`,
DATE(`time_stamp`) as `Date`,
case when `time_stamp` is null then 'N/A' else DATE(`time_stamp`) end as
`Test1`,
ifnull((DATE(`time_stamp`)),'N/A') as `Test2`,
if(`time_stamp` is null, 'N/A', DATE(`time_stamp`)) as `Test3`,
if(`time_stamp`<='2010-11-08 17:46:44',DATE(`time_stamp`),'N/A') as `Test4`,
if(`time_stamp`<='2010-11-08 17:46:44',DATE(`time_stamp`),DATE('2010-11-08 17:46:44')) as `Test5`
from testnulldate;
select
id,
`time_stamp`,
YEAR(`time_stamp`) as `Date`,
case when `time_stamp` is null then 'N/A' else YEAR(`time_stamp`) end as
`Test1`,
ifnull((YEAR(`time_stamp`)),'N/A') as `Test2`,
if(`time_stamp` is null, 'N/A', YEAR(`time_stamp`)) as `Test3`,
if(`time_stamp`<='2010-11-08 17:46:44',YEAR(`time_stamp`),'N/A') as `Test4`,
if(`time_stamp`<='2010-11-08 17:46:44',YEAR(`time_stamp`),DATE('2010-11-08 17:46:44')) as `Test5`
from testnulldate;
select
id,
case when `time_stamp` is null then 'N/A' end as `Test1`
from testnulldate;
drop table if exists testnulldate;
#

View File

@ -0,0 +1,28 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3258.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists var_between;
create table var_between (c1 varchar(10), c2 char(7)) engine=columnstore;
insert into var_between values ('099', '099');
insert into var_between values ('9', '9');
insert into var_between values ('1', '1');
select 'q1', var_between.* from var_between where substr(c1,1,1) between '0' and '9';
select 'q2', var_between.* from var_between where substr(c1,1,1) not between '0' and '9';
select 'q3', var_between.* from var_between where substr(c2,1,1) between '0' and '9';
select 'q4', var_between.* from var_between where substr(c2,1,1) not between '0' and '9';
drop table var_between;
select 'q5', count(*) from orders where substr(o_comment, 1, 1) between 'a' and 'f';
select 'q6', count(*) from orders where substr(o_orderpriority, 1, 1) between '2' and '3';
select 'q7', count(*) from orders where substr(o_orderpriority, 1, 1) not between '2' and '3';
select 'q8', count(*) from orders where substr(o_totalprice, 2, 3) between '200' and '300';
select 'q9', count(*) from orders where substr(o_totalprice, 2, 3) not between '200' and '300';
#

View File

@ -0,0 +1,23 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3262.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
--exec rm -f /tmp/natcount.tbl
select count(*) from nation into outfile '/tmp/natcount.tbl';
--exec rm -f /tmp/natcount.tbl
select count(*) into outfile '/tmp/natcount.tbl' from nation;
select count(*) from nation;
--exec rm -f /var/lib/mysql/tpch1/nation.out
--exec rm -f /var/lib/mysql/tpch1c/nation.out
select count(*) from nation into outfile 'nation.out';
--exec rm -f /var/lib/mysql/tpch1/nation.out
--exec rm -f /var/lib/mysql/tpch1c/nation.out
#

View File

@ -0,0 +1,18 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3267.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3267;
create table bug3267 (c1 decimal(12, 6), c2 float) engine=columnstore;
insert into bug3267 values (5.240620, 5.24062e+06), (7.240620, 7.24062e+06), (9.940620, 9.94062e+06), (5.240620, 5.24062), (-4.44, -4.44), (-8.87, -8.87);
select floor(c1), ceil(c1), c1 from bug3267;
select floor(c2), ceil(c2), c2 from bug3267;
drop table if exists bug3267;
#

View File

@ -0,0 +1,28 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3270.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3270;
create table bug3270 (c1 decimal(12, 6), c2 float) engine=columnstore;
insert into bug3270
values (5.240620, 5.24062e+06), (7.240620, 7.24062e+06), (9.940620, 9.94062e+06), (5.240620, 5.24062), (5.240720, 5.240720),
(5.240720, 5.240720), (5.240720, 5.240720), (-4.23, -4.23), (-8.89, -8.89);
insert into bug3270 values (-5.240620, -5.24062e+06), (-7.240620, -7.24062e+06), (-9.940620, -9.94062e+06),
(-5.240620, -5.24062), (-5.240720, -5.240720), (-5.240720, -5.240720), (-5.240720, -5.240720);
insert into bug3270 values (-18.9479, -18.9479), (45.1557, 45.1557);
select floor(c1), ceil(c1), c1 from bug3270 order by 1,2,3;
select floor(c2), ceil(c2), c2 from bug3270 order by 1,2,3;
select truncate(c1, 0), truncate(c1, 1), truncate(c1, 2) from bug3270 order by 1,2,3;
select truncate(c2, 0), truncate(c2, 1), truncate(c2, 2) from bug3270 order by 1,2,3;
select truncate(c2 ,2), count(*) from bug3270 group by 1 order by 1, 2;
drop table if exists bug3270;
#

View File

@ -0,0 +1,26 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3272.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3272;
create table bug3272 (c1 float, c2 char(12)) engine=columnstore;
insert into bug3272 values (5.24062, '5.24062'), (7.24062, '7.24062'), (9.94062, '9.94062');
insert into bug3272 values (-5.24062, '-5.24062'), (-7.24062, '-7.24062'), (-9.94062, '-9.94062');
insert into bug3272 values (5.24562, '5.24562'), (7.24562, '7.24562'), (9.94562, '9.94562');
insert into bug3272 values (-5.24562, '-5.24562'), (-7.24562, '-7.24562'), (-9.94562, '-9.94562');
select cast(c1 as decimal(4,2)) floattype, cast(c2 as decimal(4,2)) chartype from bug3272 order by 1, 2;
select cast(c1 as decimal(0,0)) floattype, cast(c2 as decimal(0,0)) chartype from bug3272 order by 1, 2;
select cast(c1 as signed) floattype, cast(c2 as signed) chartype from bug3272 order by 1, 2;
select cast(cast(c1 as decimal(4,2)) as signed) decimaltype, cast(c2 as signed) chartype from bug3272 order by 1, 2;
drop table if exists bug3272;
#

View File

@ -0,0 +1,21 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3274.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3274;
create table bug3274(d2 decimal(4,2), f float);
insert into bug3274 values (43.34, 43.345), (13.54, 13.545);
select d2, count(*) from bug3274 group by 1 order by 1;
select f, count(*) from bug3274 group by 1 order by 1;
select * from (select d2, count(*) from bug3274 group by 1 order by 1) a;
select * from (select f, count(*) from bug3274 group by 1 order by 1) a;
drop table if exists bug3274;
#

View File

@ -0,0 +1,30 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3279.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
set autocommit=0;
select 'q1', nation.* from nation;
update nation set n_comment='x' where n_nationkey <= n_regionkey;
select 'q2', nation.* from nation;
rollback;
select 'q3', nation.* from nation;
update nation set n_comment='x' where n_nationkey = n_regionkey;
select 'q4', nation.* from nation;
rollback;
select 'q5', nation.* from nation;
update nation set n_comment='x' where n_nationkey > n_regionkey;
select 'q6', nation.* from nation;
rollback;
select 'q7', count(*) from orders where o_orderkey<o_custkey and o_shippriority < o_custkey;
update orders set o_orderkey=o_custkey where o_orderkey<o_custkey and o_shippriority < o_custkey;
select 'q8', count(*) from orders where o_orderkey=o_custkey and o_shippriority < o_custkey;
rollback;
#

View File

@ -0,0 +1,16 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3283.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
# Negative test case for attempting to drop a non-existent partition.
select caldroppartitions('lineitem', '4.1.1');
select caldisablepartitions('lineitem', '4.1.1');
#

View File

@ -0,0 +1,45 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3292.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3292;
create table bug3292 (c1 double, c2 float, c3 char(12)) engine=columnstore;
insert into bug3292 values
(5.24062, 5.24062, '5.24062'),
(5.24062, 5.24062, '5.24062'),
(3.24062, 3.24062, '3.24062'),
(9.24062, 9.24062, '9.24062'),
(-5.24062, -5.24062, '-5.24062'),
(-3.24062, -3.24062, '-3.24062'),
(-9.24062, -9.24062, '-9.24062'),
(5.24562, 5.24562, '5.24562'),
(3.24562, 3.24562, '3.24562'),
(9.94562, 9.94562, '9.94562'),
(-5.24562, -5.24562, '-5.24562'),
(-3.24562, -3.24562, '-3.24562'),
(-9.94562, -9.94562, '-9.94562'),
(-3.2e-10, -3.2e-10, '-3.2e-10'),
(3.2e-10, 3.2e-10, '3.2e-10'),
(-3.2e10, -3.2e10, '-3.2e10'),
(3.2e10, 3.2e10, '3.2e10'),
(-3.2e30, -3.2e30, '-3.2e30'),
(3.2e30, 3.2e30, '3.2e30');
select c1, format(c1, 0), format(c2,0), format(c3,0) from bug3292;
select c1, format(c1, 1), format(c2,1), format(c3,1) from bug3292;
select c1, format(c1, 2), format(c2,2), format(c3,2) from bug3292;
select c1, format(c1, 3), format(c2,2), format(c3,2) from bug3292;
select c1, format(c1, 4), format(c2,2), format(c3,2) from bug3292;
select c1, format(c1, 5), format(c2,2), format(c3,2) from bug3292;
select c1, format(c1, 6), format(c2,6), format(c3,6) from bug3292;
select c1, format(c1, -1), format(c2,-1), format(c3,-1) from bug3292;
drop table if exists bug3292;
#

View File

@ -0,0 +1,86 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3295.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists visit;
drop table if exists client;
create table visit (id_client integer,nb_event integer,update_date datetime, visit_date datetime) engine=columnstore;
create table client (id_client integer,id_event integer,event_date datetime) engine=columnstore;
insert into visit values (1,0,NULL,"2010-09-08");
insert into visit values (2,0,NULL,"2010-09-08");
insert into visit values (2,0,NULL,"2010-09-10");
insert into visit values (3,0,NULL,"2010-09-08");
insert into visit values (3,0,NULL,"2010-09-10");
insert into client values (1,20,"2010-09-07");
insert into client values (1,21,"2010-09-07");
insert into client values (1,22,"2010-09-07");
insert into client values (2,23,"2010-09-07");
insert into client values (2,24,"2010-09-07");
insert into client values (2,25,"2010-09-10");
insert into client values (3,29,"2010-09-10");
select * from
visit V,
(
SELECT
CL.id_client,
COUNT(CL.id_event) as nb_event
FROM
client CL
WHERE
CL.event_date < "2010-09-10"
GROUP BY
CL.id_client
) Res
WHERE
V.visit_date ="2010-09-08"
AND V.id_client = Res.id_client order by 1, 2, 3;
UPDATE
visit V,
(
SELECT
CL.id_client,
COUNT(CL.id_event) as nb_event
FROM
client CL
WHERE
CL.event_date < "2010-09-10"
GROUP BY
CL.id_client
) Res
SET
V.nb_event = Res.nb_event,
V.update_date = '2010-12-11'
WHERE
V.visit_date ="2010-09-08"
AND V.id_client = Res.id_client;
select * from
visit V,
(
SELECT
CL.id_client,
COUNT(CL.id_event) as nb_event
FROM
client CL
WHERE
CL.event_date < "2010-09-10"
GROUP BY
CL.id_client
) Res
WHERE
V.visit_date ="2010-09-08"
AND V.id_client = Res.id_client order by 1, 2, 3;
drop table if exists visit;
drop table if exists client;
#

View File

@ -0,0 +1,30 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3312.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists user_prop_by_game;
drop table if exists visit;
create table user_prop_by_game(cl_id int, last_visit_date date)engine=columnstore;
create table visit(cl_id int, visit_date date)engine=columnstore;
insert into user_prop_by_game values (1, now()), (2, now());
insert into visit values (1, '2010-10-01'), (2, '2010-11-01'), (2,
'2010-10-01');
UPDATE user_prop_by_game UPBG, (SELECT cl_id, max(visit_date) AS max_date FROM
visit GROUP BY cl_id) sub SET UPBG.last_visit_date = sub.max_date WHERE
UPBG.cl_id = sub.cl_id;
select * from user_prop_by_game;
drop table if exists user_prop_by_game;
drop table if exists visit;
#

View File

@ -0,0 +1,68 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3314.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists paa;
drop table if exists dates;
drop table if exists t;
create table paa (
p_id int,
a_id int,
date_id int
) ENGINE=Columnstore DEFAULT CHARSET=latin1;
insert into paa values
(1, 10, 100),
(2, 20, 100);
create table dates (
date_id int,
dates date
) ENGINE=Columnstore DEFAULT CHARSET=latin1;
insert into dates values
(100, '2010-09-01');
create table t (
p_id int,
a_id int,
date_id int,
amount int
) ENGINE=Columnstore DEFAULT CHARSET=latin1;
insert into t values
(2, 20, 100, 99999);
select p.p_id,
p.a_id,
ifnull(`new_sales_amount`,0),
ifnull(`new_sales_amount_ok`,0),
p.dates as 'Date'
from (select aaa.p_id, aaa.a_id, dof.date_id, dof.dates
from (select paa.p_id, paa.a_id, 1 as xxx
from paa
) aaa
join (select date_id, 1 as xxx, dates from dates) dof on (dof.xxx=aaa.xxx)
) p
left outer join (select t.date_id, t.p_id, a_id,
IF(t.amount = 99999, amount, 0) / 10000 as 'new_sales_amount',
IF(t.amount = 99999, amount, 0) as 'new_sales_amount_ok'
from t
) tx
on (p.p_id = tx.p_id
and p.a_id = tx.a_id
and p.date_id = tx.date_id)
order by 1, 2, 3;
drop table if exists paa;
drop table if exists dates;
drop table if exists t;
#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3331.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select if(sum(r_regionkey)>1, r_name, r_regionkey) from region group by r_name, r_regionkey order by 1;
#

View File

@ -0,0 +1,42 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3333.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
drop table if exists datetest;
create table if not exists datetest (rowid int, c1 varchar(20), c2 bigint) engine=columnstore;
insert into datetest values (1, "1990-10-20", 19901121), (2, "1997-01-01 10:00:05", 19970201000000), (3, "0705", 0805), (4, "20120230", 20120230),(5, "20110229", 20110229),(6, "9905", 9905),(7, "20011010888888", 20031010888888),(8, "20011011124455", 20011010122233);
select 'q1', rowid, c1, c2, cast(c1 as date), cast(c2 as date) from datetest where c2 <> 0805 order by rowid;
select 'q1b', rowid, c1, c2, cast(c1 as date), substr(cast(c2 as date), 6, 5) from datetest where c2 = 0805 order by rowid;
select 'q2', rowid, c1, c2, cast(c1 as date), cast(c2 as datetime) from datetest where c2 <> 0805 order by rowid;
select 'q2b', rowid, c1, c2, cast(c1 as date), substr(cast(c2 as datetime), 6, 14) from datetest where c2 = 0805 order by rowid;
select 'q3', rowid, c1, c2, quarter(c1), quarter(c2) from datetest order by rowid;
select 'q4', rowid, c1, c2 from datetest where quarter(c1) = quarter(c2) order by rowid;
select 'q5', rowid, c1, c2, timediff(c1,c2) from datetest order by rowid;
select 'q6', rowid, c1, c2, date_format(c1, '%W %M %Y'), date_format(c2, '%H:%i:%s') from datetest order by rowid;
select 'q7', rowid, c1, c2, c1 + interval 2 day, c2 + interval 12 hour from datetest where c2 <> 0805 order by rowid;
select 'q7b', rowid, c1, c2, c1 + interval 2 day, substr(c2 + interval 12 hour, 6, 14) from datetest where c2 = 0805 order by rowid;
select 'q8', rowid, c1, c2, minute(c1), minute(c2) from datetest order by rowid;
select 'q9', rowid, c1, c2, day(c1), day(c2) from datetest order by 1,2;
select 'q10', rowid, c1, c2, hour(c1), hour(c2) from datetest order by 1,2;
select 'q11', rowid, c1, c2, dayofweek(c1), dayofweek(c2) from datetest where c2 <> 0805 order by 1,2;
select 'q12', rowid, c1, c2, dayofyear(c1), dayofyear(c2) from datetest where c2 <> 0805 order by 1,2;
select 'q13', rowid, c1, c2, week(c1), week(c2) from datetest where c2 <> 0805 order by 1,2;
select 'q14', rowid, second(c1), second(c2) from datetest order by 1,2;
select 'q15', rowid, c1, c2, year(c1), year(c2) from datetest where c2 <> 0805 order by 1,2;
select 'q16', rowid, c1, c2, month(c1), month(c2) from datetest order by 1,2;
select 'q17', rowid, c1, c2, time(c1), time(c2) from datetest order by 1,2;
drop table if exists datetest;
select 'q18', year(lo_orderdate), month(lo_orderdate), count(*) from ssb1.lineorder group by 1, 2, 3 order by 1, 2, 3;
#

View File

@ -0,0 +1,446 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3334_ceil.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select ceiling(month(l_shipdate)/3), count(*) from lineitem group by 1 order by 1;
select 'ceil(id)', id as id, ceiling(id) from dtypes;
select 'ceil(id/3)', id as id, ceil(id/3) as val from dtypes;
select 'ceil(dt)', id as id, dt, ceiling(dt) from dtypes;
select 'ceil(dtm)', id as id, dtm, ceiling(dtm) from dtypes;
select 'ceil(f)', id as id, f, ceiling(f) from dtypes;
select 'ceil(f/3)', id as id, ceil(f/3) as val from dtypes;
select 'ceil(db)', id as id, db, ceiling(db) from dtypes;
select 'ceil(db/3)', id as id, ceil(db/3) as val from dtypes;
select 'ceil(ti)', id as id, ti, ceiling(ti) from dtypes;
select 'ceil(ti/3)', id as id, ceil(ti/3) as val from dtypes;
select 'ceil(si)', id as id, si, ceiling(si) from dtypes;
select 'ceil(si/3)', id as id, ceil(si/3) as val from dtypes;
select 'ceil(i)', id as id, i, ceiling(i) from dtypes;
select 'ceil(i/3)', id as id, ceil(i/3) as val from dtypes;
select 'ceil(bi)', id as id, bi, ceiling(bi) from dtypes;
select 'ceil(bi/3)', id as id, ceil(bi/3) as val from dtypes;
select 'ceil(c1)', id as id, c1, ceiling(c1) from dtypes;
select 'ceil(c1/3)', id as id, ceil(c1/3) as val from dtypes;
select 'ceil(c2)', id as id, c2, ceiling(c2) from dtypes;
select 'ceil(c2/3)', id as id, ceil(c2/3) as val from dtypes;
select 'ceil(c3)', id as id, c3, ceiling(c3) from dtypes;
select 'ceil(c3/3)', id as id, ceil(c3/3) as val from dtypes;
select 'ceil(c4)', id as id, c4, ceiling(c4) from dtypes;
select 'ceil(c4/3)', id as id, ceil(c4/3) as val from dtypes;
select 'ceil(c5)', id as id, c5, ceiling(c5) from dtypes;
select 'ceil(c5/3)', id as id, ceil(c5/3) as val from dtypes;
select 'ceil(c6)', id as id, c6, ceiling(c6) from dtypes;
select 'ceil(c6/3)', id as id, ceil(c6/3) as val from dtypes;
select 'ceil(c7)', id as id, c7, ceiling(c7) from dtypes;
select 'ceil(c7/3)', id as id, ceil(c7/3) as val from dtypes;
select 'ceil(c8)', id as id, c8, ceiling(c8) from dtypes;
select 'ceil(c8/3)', id as id, ceil(c8/3) as val from dtypes;
select 'ceil(c9)', id as id, c9, ceiling(c9) from dtypes;
select 'ceil(c9/3)', id as id, ceil(c9/3) as val from dtypes;
select 'ceil(c255)', id as id, c255, ceiling(c255) from dtypes;
select 'ceil(c255/3)', id as id, ceil(c255/3) as val from dtypes;
select 'ceil(vc1)', id as id, vc1, ceiling(vc1) from dtypes;
select 'ceil(vc1/3)', id as id, ceil(vc1/3) as val from dtypes;
select 'ceil(vc2)', id as id, vc2, ceiling(vc2) from dtypes;
select 'ceil(vc2/3)', id as id, ceil(vc2/3) as val from dtypes;
select 'ceil(vc3)', id as id, vc3, ceiling(vc3) from dtypes;
select 'ceil(vc3/3)', id as id, ceil(vc3/3) as val from dtypes;
select 'ceil(vc4)', id as id, vc4, ceiling(vc4) from dtypes;
select 'ceil(vc4/3)', id as id, ceil(vc4/3) as val from dtypes;
select 'ceil(vc5)', id as id, vc5, ceiling(vc5) from dtypes;
select 'ceil(vc5/3)', id as id, ceil(vc5/3) as val from dtypes;
select 'ceil(vc6)', id as id, vc6, ceiling(vc6) from dtypes;
select 'ceil(vc6/3)', id as id, ceil(vc6/3) as val from dtypes;
select 'ceil(vc7)', id as id, vc7, ceiling(vc7) from dtypes;
select 'ceil(vc7/3)', id as id, ceil(vc7/3) as val from dtypes;
select 'ceil(vc8)', id as id, vc8, ceiling(vc8) from dtypes;
select 'ceil(vc8/3)', id as id, ceil(vc8/3) as val from dtypes;
select 'ceil(vc255)', id as id, vc255, ceiling(vc255) from dtypes;
select 'ceil(vc255/3)', id as id, ceil(vc255/3) as val from dtypes;
select 'ceil(d1)', id as id, d1, ceiling(d1) from dtypes;
select 'ceil(d1/3)', id as id, ceil(d1/3) as val from dtypes;
select 'ceil(d2)', id as id, d2, ceiling(d2) from dtypes;
select 'ceil(d2/3)', id as id, ceil(d2/3) as val from dtypes;
select 'ceil(d3)', id as id, d3, ceiling(d3) from dtypes;
select 'ceil(d3/3)', id as id, ceil(d3/3) as val from dtypes;
select 'ceil(d4)', id as id, d4, ceiling(d4) from dtypes;
select 'ceil(d4/3)', id as id, ceil(d4/3) as val from dtypes;
select 'ceil(d5)', id as id, d5, ceiling(d5) from dtypes;
select 'ceil(d5/3)', id as id, ceil(d5/3) as val from dtypes;
select 'ceil(d6)', id as id, d6, ceiling(d6) from dtypes;
select 'ceil(d6/3)', id as id, ceil(d6/3) as val from dtypes;
select 'ceil(d7)', id as id, d7, ceiling(d7) from dtypes;
select 'ceil(d7/3)', id as id, ceil(d7/3) as val from dtypes;
select 'ceil(d8)', id as id, d8, ceiling(d8) from dtypes;
select 'ceil(d8/3)', id as id, ceil(d8/3) as val from dtypes;
select 'ceil(d9)', id as id, d9, ceiling(d9) from dtypes;
select 'ceil(d9/3)', id as id, ceil(d9/3) as val from dtypes;
select 'ceil(d10)', id as id, d10, ceiling(d10) from dtypes;
select 'ceil(d10/3)', id as id, ceil(d10/3) as val from dtypes;
select 'ceil(d11)', id as id, d11, ceiling(d11) from dtypes;
select 'ceil(d11/3)', id as id, ceil(d11/3) as val from dtypes;
select 'ceil(d12)', id as id, d12, ceiling(d12) from dtypes;
select 'ceil(d12/3)', id as id, ceil(d12/3) as val from dtypes;
select 'ceil(d13)', id as id, d13, ceiling(d13) from dtypes;
select 'ceil(d13/3)', id as id, ceil(d13/3) as val from dtypes;
select 'ceil(d14)', id as id, d14, ceiling(d14) from dtypes;
select 'ceil(d14/3)', id as id, ceil(d14/3) as val from dtypes;
select 'ceil(d15)', id as id, d15, ceiling(d15) from dtypes;
select 'ceil(d15/3)', id as id, ceil(d15/3) as val from dtypes;
select 'ceil(d16)', id as id, d16, ceiling(d16) from dtypes;
select 'ceil(d16/3)', id as id, ceil(d16/3) as val from dtypes;
select 'ceil(d17)', id as id, d17, ceiling(d17) from dtypes;
select 'ceil(d17/3)', id as id, ceil(d17/3) as val from dtypes;
select 'ceil(d18)', id as id, d18, ceiling(d18) from dtypes;
select 'ceil(d18/3)', id as id, ceil(d18/3) as val from dtypes;
select 'ceil(d19)', id as id, d19, ceiling(d19) from dtypes;
select 'ceil(d19/3)', id as id, ceil(d19/3) as val from dtypes;
select 'ceil(d20)', id as id, d20, ceiling(d20) from dtypes;
select 'ceil(d20/3)', id as id, ceil(d20/3) as val from dtypes;
select 'ceil(d21)', id as id, d21, ceiling(d21) from dtypes;
select 'ceil(d21/3)', id as id, d21/3, ceil(d21/3) as val from dtypes;
select 'ceil(d22)', id as id, d22, ceiling(d22) from dtypes;
select 'ceil(d22/3)', id as id, d22/3, ceil(d22/3) as val from dtypes;
select 'ceil(d23)', id as id, d23, ceiling(d23) from dtypes;
select 'ceil(d23/3)', id as id, d23/3, ceil(d23/3) as val from dtypes;
select 'ceil(d24)', id as id, d24, ceiling(d24) from dtypes;
select 'ceil(d24/3)', id as id, d24/3, ceil(d24/3) as val from dtypes;
select 'ceil(d25)', id as id, d25, ceiling(d25) from dtypes;
select 'ceil(d25/3)', id as id, d25/3, ceil(d25/3) as val from dtypes;
select 'ceil(d26)', id as id, d26, ceiling(d26) from dtypes;
select 'ceil(d26/3)', id as id, d26/3, ceil(d26/3) as val from dtypes;
select 'ceil(d27)', id as id, d27, ceiling(d27) from dtypes;
select 'ceil(d27/3)', id as id, d27/3, ceil(d27/3) as val from dtypes;
select 'ceil(d28)', id as id, d28, ceiling(d28) from dtypes;
select 'ceil(d28/3)', id as id, d28/3, ceil(d28/3) as val from dtypes;
select 'ceil(d29)', id as id, d29, ceiling(d29) from dtypes;
select 'ceil(d29/3)', id as id, d29/3, ceil(d29/3) as val from dtypes;
select 'ceil(d30)', id as id, d30, ceiling(d30) from dtypes;
select 'ceil(d30/3)', id as id, d30/3, ceil(d30/3) as val from dtypes;
select 'ceil(d31)', id as id, d31, ceiling(d31) from dtypes;
select 'ceil(d31/3)', id as id, d31/3, ceil(d31/3) as val from dtypes;
select 'ceil(d32)', id as id, d32, ceiling(d32) from dtypes;
select 'ceil(d32/3)', id as id, d32/3, ceil(d32/3) as val from dtypes;
select 'ceil(d33)', id as id, d33, ceiling(d33) from dtypes;
select 'ceil(d33/3)', id as id, d33/3, ceil(d33/3) as val from dtypes;
select 'ceil(d34)', id as id, d34, ceiling(d34) from dtypes;
select 'ceil(d34/3)', id as id, d34/3, ceil(d34/3) as val from dtypes;
select 'ceil(d35)', id as id, d35, ceiling(d35) from dtypes;
select 'ceil(d35/3)', id as id, d35/3, ceil(d35/3) as val from dtypes;
select 'ceil(d36)', id as id, d36, ceiling(d36) from dtypes;
select 'ceil(d36/3)', id as id, d36/3, ceil(d36/3) as val from dtypes;
select 'ceil(d37)', id as id, d37, ceiling(d37) from dtypes;
select 'ceil(d37/3)', id as id, d37/3, ceil(d37/3) as val from dtypes;
select 'ceil(d38)', id as id, d38, ceiling(d38) from dtypes;
select 'ceil(d38/3)', id as id, d38/3, ceil(d38/3) as val from dtypes;
select 'ceil(d39)', id as id, d39, ceiling(d39) from dtypes;
select 'ceil(d39/3)', id as id, d39/3, ceil(d39/3) as val from dtypes;
select 'ceil(d40)', id as id, d40, ceiling(d40) from dtypes;
select 'ceil(d40/3)', id as id, d40/3, ceil(d40/3) as val from dtypes;
select 'ceil(d41)', id as id, d41, ceiling(d41) from dtypes;
select 'ceil(d41/3)', id as id, d41/3, ceil(d41/3) as val from dtypes;
select 'ceil(d42)', id as id, d42, ceiling(d42) from dtypes;
select 'ceil(d42/3)', id as id, d42/3, ceil(d42/3) as val from dtypes;
select 'ceil(d43)', id as id, d43, ceiling(d43) from dtypes;
select 'ceil(d43/3)', id as id, d43/3, ceil(d43/3) as val from dtypes;
select 'ceil(d44)', id as id, d44, ceiling(d44) from dtypes;
select 'ceil(d44/3)', id as id, d44/3, ceil(d44/3) as val from dtypes;
select 'ceil(d45)', id as id, d45, ceiling(d45) from dtypes;
select 'ceil(d45/3)', id as id, d45/3, ceil(d45/3) as val from dtypes;
select 'ceil(d46)', id as id, d46, ceiling(d46) from dtypes;
select 'ceil(d46/3)', id as id, d46/3, ceil(d46/3) as val from dtypes;
select 'ceil(d47)', id as id, d47, ceiling(d47) from dtypes;
select 'ceil(d47/3)', id as id, d47/3, ceil(d47/3) as val from dtypes;
select 'ceil(d48)', id as id, d48, ceiling(d48) from dtypes;
select 'ceil(d48/3)', id as id, d48/3, ceil(d48/3) as val from dtypes;
select 'ceil(d49)', id as id, d49, ceiling(d49) from dtypes;
select 'ceil(d49/3)', id as id, d49/3, ceil(d49/3) as val from dtypes;
select 'ceil(d50)', id as id, d50, ceiling(d50) from dtypes;
select 'ceil(d50/3)', id as id, d50/3, ceil(d50/3) as val from dtypes;
select 'ceil(d51)', id as id, d51, ceiling(d51) from dtypes;
select 'ceil(d51/3)', id as id, d51/3, ceil(d51/3) as val from dtypes;
select 'ceil(d52)', id as id, d52, ceiling(d52) from dtypes;
select 'ceil(d52/3)', id as id, d52/3, ceil(d52/3) as val from dtypes;
select 'ceil(d53)', id as id, d53, ceiling(d53) from dtypes;
select 'ceil(d53/3)', id as id, d53/3, ceil(d53/3) as val from dtypes;
select 'ceil(d54)', id as id, d54, ceiling(d54) from dtypes;
select 'ceil(d54/3)', id as id, d54/3, ceil(d54/3) as val from dtypes;
select 'ceil(d55)', id as id, d55, ceiling(d55) from dtypes;
select 'ceil(d55/3)', id as id, d55/3, ceil(d55/3) as val from dtypes;
select 'ceil(d56)', id as id, d56, ceiling(d56) from dtypes;
select 'ceil(d56/3)', id as id, d56/3, ceil(d56/3) as val from dtypes;
select 'ceil(d57)', id as id, d57, ceiling(d57) from dtypes;
select 'ceil(d57/3)', id as id, d57/3, ceil(d57/3) as val from dtypes;
select 'ceil(d58)', id as id, d58, ceiling(d58) from dtypes;
select 'ceil(d58/3)', id as id, d58/3, ceil(d58/3) as val from dtypes;
select 'ceil(d59)', id as id, d59, ceiling(d59) from dtypes;
select 'ceil(d59/3)', id as id, d59/3, ceil(d59/3) as val from dtypes;
select 'ceil(d60)', id as id, d60, ceiling(d60) from dtypes;
select 'ceil(d60/3)', id as id, d60/3, ceil(d60/3) as val from dtypes;
select 'ceil(d61)', id as id, d61, ceiling(d61) from dtypes;
select 'ceil(d61/3)', id as id, d61/3, ceil(d61/3) as val from dtypes;
select 'ceil(d62)', id as id, d62, ceiling(d62) from dtypes;
select 'ceil(d62/3)', id as id, d62/3, ceil(d62/3) as val from dtypes;
select 'ceil(d63)', id as id, d63, ceiling(d63) from dtypes;
select 'ceil(d63/3)', id as id, d63/3, ceil(d63/3) as val from dtypes;
select 'ceil(d64)', id as id, d64, ceiling(d64) from dtypes;
select 'ceil(d64/3)', id as id, d64/3, ceil(d64/3) as val from dtypes;
select 'ceil(d65)', id as id, d65, ceiling(d65) from dtypes;
select 'ceil(d65/3)', id as id, d65/3, ceil(d65/3) as val from dtypes;
select 'ceil(d66)', id as id, d66, ceiling(d66) from dtypes;
select 'ceil(d66/3)', id as id, d66/3, ceil(d66/3) as val from dtypes;
select 'ceil(d67)', id as id, d67, ceiling(d67) from dtypes;
select 'ceil(d67/3)', id as id, d67/3, ceil(d67/3) as val from dtypes;
select 'ceil(d68)', id as id, d68, ceiling(d68) from dtypes;
select 'ceil(d68/3)', id as id, d68/3, ceil(d68/3) as val from dtypes;
select 'ceil(d69)', id as id, d69, ceiling(d69) from dtypes;
select 'ceil(d69/3)', id as id, d69/3, ceil(d69/3) as val from dtypes;
select 'ceil(d70)', id as id, d70, ceiling(d70) from dtypes;
select 'ceil(d70/3)', id as id, d70/3, ceil(d70/3) as val from dtypes;
select 'ceil(d71)', id as id, d71, ceiling(d71) from dtypes;
select 'ceil(d71/3)', id as id, d71/3, ceil(d71/3) as val from dtypes;
select 'ceil(d72)', id as id, d72, ceiling(d72) from dtypes;
select 'ceil(d72/3)', id as id, d72/3, ceil(d72/3) as val from dtypes;
select 'ceil(d73)', id as id, d73, ceiling(d73) from dtypes;
select 'ceil(d73/3)', id as id, d73/3, ceil(d73/3) as val from dtypes;
select 'ceil(d74)', id as id, d74, ceiling(d74) from dtypes;
select 'ceil(d74/3)', id as id, d74/3, ceil(d74/3) as val from dtypes;
select 'ceil(d75)', id as id, d75, ceiling(d75) from dtypes;
select 'ceil(d75/3)', id as id, d75/3, ceil(d75/3) as val from dtypes;
select 'ceil(d76)', id as id, d76, ceiling(d76) from dtypes;
select 'ceil(d76/3)', id as id, d76/3, ceil(d76/3) as val from dtypes;
select 'ceil(d77)', id as id, d77, ceiling(d77) from dtypes;
select 'ceil(d77/3)', id as id, d77/3, ceil(d77/3) as val from dtypes;
select 'ceil(d78)', id as id, d78, ceiling(d78) from dtypes;
select 'ceil(d78/3)', id as id, d78/3, ceil(d78/3) as val from dtypes;
select 'ceil(d79)', id as id, d79, ceiling(d79) from dtypes;
select 'ceil(d79/3)', id as id, d79/3, ceil(d79/3) as val from dtypes;
select 'ceil(d80)', id as id, d80, ceiling(d80) from dtypes;
select 'ceil(d80/3)', id as id, d80/3, ceil(d80/3) as val from dtypes;
select 'ceil(d81)', id as id, d81, ceiling(d81) from dtypes;
select 'ceil(d81/3)', id as id, d81/3, ceil(d81/3) as val from dtypes;
select 'ceil(d82)', id as id, d82, ceiling(d82) from dtypes;
select 'ceil(d82/3)', id as id, d82/3, ceil(d82/3) as val from dtypes;
select 'ceil(d83)', id as id, d83, ceiling(d83) from dtypes;
select 'ceil(d83/3)', id as id, d83/3, ceil(d83/3) as val from dtypes;
select 'ceil(d84)', id as id, d84, ceiling(d84) from dtypes;
select 'ceil(d84/3)', id as id, d84/3, ceil(d84/3) as val from dtypes;
select 'ceil(d85)', id as id, d85, ceiling(d85) from dtypes;
select 'ceil(d85/3)', id as id, d85/3, ceil(d85/3) as val from dtypes;
select 'ceil(d86)', id as id, d86, ceiling(d86) from dtypes;
select 'ceil(d86/3)', id as id, d86/3, ceil(d86/3) as val from dtypes;
select 'ceil(d87)', id as id, d87, ceiling(d87) from dtypes;
select 'ceil(d87/3)', id as id, d87/3, ceil(d87/3) as val from dtypes;
select 'ceil(d88)', id as id, d88, ceiling(d88) from dtypes;
select 'ceil(d88/3)', id as id, d88/3, ceil(d88/3) as val from dtypes;
select 'ceil(d89)', id as id, d89, ceiling(d89) from dtypes;
select 'ceil(d89/3)', id as id, d89/3, ceil(d89/3) as val from dtypes;
select 'ceil(d90)', id as id, d90, ceiling(d90) from dtypes;
select 'ceil(d90/3)', id as id, d90/3, ceil(d90/3) as val from dtypes;
select 'ceil(d91)', id as id, d91, ceiling(d91) from dtypes;
select 'ceil(d91/3)', id as id, d91/3, ceil(d91/3) as val from dtypes;
select 'ceil(d92)', id as id, d92, ceiling(d92) from dtypes;
select 'ceil(d92/3)', id as id, d92/3, ceil(d92/3) as val from dtypes;
select 'ceil(d93)', id as id, d93, ceiling(d93) from dtypes;
select 'ceil(d93/3)', id as id, d93/3, ceil(d93/3) as val from dtypes;
select 'ceil(d94)', id as id, d94, ceiling(d94) from dtypes;
select 'ceil(d94/3)', id as id, d94/3, ceil(d94/3) as val from dtypes;
select 'ceil(d95)', id as id, d95, ceiling(d95) from dtypes;
select 'ceil(d95/3)', id as id, d95/3, ceil(d95/3) as val from dtypes;
select 'ceil(d96)', id as id, d96, ceiling(d96) from dtypes;
select 'ceil(d96/3)', id as id, d96/3, ceil(d96/3) as val from dtypes;
select 'ceil(d97)', id as id, d97, ceiling(d97) from dtypes;
select 'ceil(d97/3)', id as id, d97/3, ceil(d97/3) as val from dtypes;
select 'ceil(d98)', id as id, d98, ceiling(d98) from dtypes;
select 'ceil(d98/3)', id as id, d98/3, ceil(d98/3) as val from dtypes;
select 'ceil(d99)', id as id, d99, ceiling(d99) from dtypes;
select 'ceil(d99/3)', id as id, d99/3, ceil(d99/3) as val from dtypes;
select 'ceil(d100)', id as id, d100, ceiling(d100) from dtypes;
select 'ceil(d100/3)', id as id, d100/3, ceil(d100/3) as val from dtypes;
select 'ceil(d101)', id as id, d101, ceiling(d101) from dtypes;
select 'ceil(d101/3)', id as id, d101/3, ceil(d101/3) as val from dtypes;
select 'ceil(d102)', id as id, d102, ceiling(d102) from dtypes;
select 'ceil(d102/3)', id as id, d102/3, ceil(d102/3) as val from dtypes;
select 'ceil(d103)', id as id, d103, ceiling(d103) from dtypes;
select 'ceil(d103/3)', id as id, d103/3, ceil(d103/3) as val from dtypes;
select 'ceil(d104)', id as id, d104, ceiling(d104) from dtypes;
select 'ceil(d104/3)', id as id, d104/3, ceil(d104/3) as val from dtypes;
select 'ceil(d105)', id as id, d105, ceiling(d105) from dtypes;
select 'ceil(d105/3)', id as id, d105/3, ceil(d105/3) as val from dtypes;
select 'ceil(d106)', id as id, d106, ceiling(d106) from dtypes;
select 'ceil(d106/3)', id as id, d106/3, ceil(d106/3) as val from dtypes;
select 'ceil(d107)', id as id, d107, ceiling(d107) from dtypes;
select 'ceil(d107/3)', id as id, d107/3, ceil(d107/3) as val from dtypes;
select 'ceil(d108)', id as id, d108, ceiling(d108) from dtypes;
select 'ceil(d108/3)', id as id, d108/3, ceil(d108/3) as val from dtypes;
select 'ceil(d109)', id as id, d109, ceiling(d109) from dtypes;
select 'ceil(d109/3)', id as id, d109/3, ceil(d109/3) as val from dtypes;
select 'ceil(d110)', id as id, d110, ceiling(d110) from dtypes;
select 'ceil(d110/3)', id as id, d110/3, ceil(d110/3) as val from dtypes;
select 'ceil(d111)', id as id, d111, ceiling(d111) from dtypes;
select 'ceil(d111/3)', id as id, d111/3, ceil(d111/3) as val from dtypes;
select 'ceil(d112)', id as id, d112, ceiling(d112) from dtypes;
select 'ceil(d112/3)', id as id, d112/3, ceil(d112/3) as val from dtypes;
select 'ceil(d113)', id as id, d113, ceiling(d113) from dtypes;
select 'ceil(d113/3)', id as id, d113/3, ceil(d113/3) as val from dtypes;
select 'ceil(d114)', id as id, d114, ceiling(d114) from dtypes;
select 'ceil(d114/3)', id as id, d114/3, ceil(d114/3) as val from dtypes;
select 'ceil(d115)', id as id, d115, ceiling(d115) from dtypes;
select 'ceil(d115/3)', id as id, d115/3, ceil(d115/3) as val from dtypes;
select 'ceil(d116)', id as id, d116, ceiling(d116) from dtypes;
select 'ceil(d116/3)', id as id, d116/3, ceil(d116/3) as val from dtypes;
select 'ceil(d117)', id as id, d117, ceiling(d117) from dtypes;
select 'ceil(d117/3)', id as id, d117/3, ceil(d117/3) as val from dtypes;
select 'ceil(d118)', id as id, d118, ceiling(d118) from dtypes;
select 'ceil(d118/3)', id as id, d118/3, ceil(d118/3) as val from dtypes;
select 'ceil(d119)', id as id, d119, ceiling(d119) from dtypes;
select 'ceil(d119/3)', id as id, d119/3, ceil(d119/3) as val from dtypes;
select 'ceil(d120)', id as id, d120, ceiling(d120) from dtypes;
select 'ceil(d120/3)', id as id, d120/3, ceil(d120/3) as val from dtypes;
select 'ceil(d121)', id as id, d121, ceiling(d121) from dtypes;
select 'ceil(d121/3)', id as id, d121/3, ceil(d121/3) as val from dtypes;
select 'ceil(d122)', id as id, d122, ceiling(d122) from dtypes;
select 'ceil(d122/3)', id as id, d122/3, ceil(d122/3) as val from dtypes;
select 'ceil(d123)', id as id, d123, ceiling(d123) from dtypes;
select 'ceil(d123/3)', id as id, d123/3, ceil(d123/3) as val from dtypes;
select 'ceil(d124)', id as id, d124, ceiling(d124) from dtypes;
select 'ceil(d124/3)', id as id, d124/3, ceil(d124/3) as val from dtypes;
select 'ceil(d125)', id as id, d125, ceiling(d125) from dtypes;
select 'ceil(d125/3)', id as id, d125/3, ceil(d125/3) as val from dtypes;
select 'ceil(d126)', id as id, d126, ceiling(d126) from dtypes;
select 'ceil(d126/3)', id as id, d126/3, ceil(d126/3) as val from dtypes;
select 'ceil(d127)', id as id, d127, ceiling(d127) from dtypes;
select 'ceil(d127/3)', id as id, d127/3, ceil(d127/3) as val from dtypes;
select 'ceil(d128)', id as id, d128, ceiling(d128) from dtypes;
select 'ceil(d128/3)', id as id, d128/3, ceil(d128/3) as val from dtypes;
select 'ceil(d129)', id as id, d129, ceiling(d129) from dtypes;
select 'ceil(d129/3)', id as id, d129/3, ceil(d129/3) as val from dtypes;
select 'ceil(d130)', id as id, d130, ceiling(d130) from dtypes;
select 'ceil(d130/3)', id as id, d130/3, ceil(d130/3) as val from dtypes;
select 'ceil(d131)', id as id, d131, ceiling(d131) from dtypes;
select 'ceil(d131/3)', id as id, d131/3, ceil(d131/3) as val from dtypes;
select 'ceil(d132)', id as id, d132, ceiling(d132) from dtypes;
select 'ceil(d132/3)', id as id, d132/3, ceil(d132/3) as val from dtypes;
select 'ceil(d133)', id as id, d133, ceiling(d133) from dtypes;
select 'ceil(d133/3)', id as id, d133/3, ceil(d133/3) as val from dtypes;
select 'ceil(d134)', id as id, d134, ceiling(d134) from dtypes;
select 'ceil(d134/3)', id as id, d134/3, ceil(d134/3) as val from dtypes;
select 'ceil(d135)', id as id, d135, ceiling(d135) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d135/3)', id as id, d135/3, ceil(d135/3) as val from dtypes;
select 'ceil(d136)', id as id, d136, ceiling(d136) from dtypes;
select 'ceil(d136/3)', id as id, d136/3, ceil(d136/3) as val from dtypes;
select 'ceil(d137)', id as id, d137, ceiling(d137) from dtypes;
select 'ceil(d137/3)', id as id, d137/3, ceil(d137/3) as val from dtypes;
select 'ceil(d138)', id as id, d138, ceiling(d138) from dtypes;
select 'ceil(d138/3)', id as id, d138/3, ceil(d138/3) as val from dtypes;
select 'ceil(d139)', id as id, d139, ceiling(d139) from dtypes;
select 'ceil(d139/3)', id as id, d139/3, ceil(d139/3) as val from dtypes;
select 'ceil(d140)', id as id, d140, ceiling(d140) from dtypes;
select 'ceil(d140/3)', id as id, d140/3, ceil(d140/3) as val from dtypes;
select 'ceil(d141)', id as id, d141, ceiling(d141) from dtypes;
select 'ceil(d141/3)', id as id, d141/3, ceil(d141/3) as val from dtypes;
select 'ceil(d142)', id as id, d142, ceiling(d142) from dtypes;
select 'ceil(d142/3)', id as id, d142/3, ceil(d142/3) as val from dtypes;
select 'ceil(d143)', id as id, d143, ceiling(d143) from dtypes;
select 'ceil(d143/3)', id as id, d143/3, ceil(d143/3) as val from dtypes;
select 'ceil(d144)', id as id, d144, ceiling(d144) from dtypes;
select 'ceil(d144/3)', id as id, d144/3, ceil(d144/3) as val from dtypes;
select 'ceil(d145)', id as id, d145, ceiling(d145) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d145/3)', id as id, d145/3, ceil(d145/3) as val from dtypes;
select 'ceil(d146)', id as id, d146, ceiling(d146) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d146/3)', id as id, d146/3, ceil(d146/3) as val from dtypes;
select 'ceil(d147)', id as id, d147, ceiling(d147) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d147/3)', id as id, d147/3, ceil(d147/3) as val from dtypes;
select 'ceil(d148)', id as id, d148, ceiling(d148) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d148/3)', id as id, d148/3, ceil(d148/3) as val from dtypes;
select 'ceil(d149)', id as id, d149, ceiling(d149) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d149/3)', id as id, d149/3, ceil(d149/3) as val from dtypes;
select 'ceil(d150)', id as id, d150, ceiling(d150) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d150/3)', id as id, d150/3, ceil(d150/3) as val from dtypes;
select 'ceil(d151)', id as id, d151, ceiling(d151) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d151/3)', id as id, d151/3, ceil(d151/3) as val from dtypes;
select 'ceil(d152)', id as id, d152, ceiling(d152) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d152/3)', id as id, d152/3, ceil(d152/3) as val from dtypes;
select 'ceil(d153)', id as id, d153, ceiling(d153) from dtypes;
select 'ceil(d153/3)', id as id, d153/3, ceil(d153/3) as val from dtypes;
select 'ceil(d154)', id as id, d154, ceiling(d154) from dtypes;
select 'ceil(d154/3)', id as id, d154/3, ceil(d154/3) as val from dtypes;
select 'ceil(d155)', id as id, d155, ceiling(d155) from dtypes;
select 'ceil(d155/3)', id as id, d155/3, ceil(d155/3) as val from dtypes;
select 'ceil(d156)', id as id, d156, ceiling(d156) from dtypes;
select 'ceil(d156/3)', id as id, d156/3, ceil(d156/3) as val from dtypes;
select 'ceil(d157)', id as id, d157, ceiling(d157) from dtypes;
select 'ceil(d157/3)', id as id, d157/3, ceil(d157/3) as val from dtypes;
select 'ceil(d158)', id as id, d158, ceiling(d158) from dtypes;
select 'ceil(d158/3)', id as id, d158/3, ceil(d158/3) as val from dtypes;
select 'ceil(d159)', id as id, d159, ceiling(d159) from dtypes;
select 'ceil(d159/3)', id as id, d159/3, ceil(d159/3) as val from dtypes;
select 'ceil(d160)', id as id, d160, ceiling(d160) from dtypes;
select 'ceil(d160/3)', id as id, d160/3, ceil(d160/3) as val from dtypes;
select 'ceil(d161)', id as id, d161, ceiling(d161) from dtypes;
select 'ceil(d161/3)', id as id, d161/3, ceil(d161/3) as val from dtypes;
select 'ceil(d162)', id as id, d162, ceiling(d162) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d162/3)', id as id, d162/3, ceil(d162/3) as val from dtypes;
select 'ceil(d163)', id as id, d163, ceiling(d163) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d163/3)', id as id, d163/3, ceil(d163/3) as val from dtypes;
select 'ceil(d164)', id as id, d164, ceiling(d164) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d164/3)', id as id, d164/3, ceil(d164/3) as val from dtypes;
select 'ceil(d165)', id as id, d165, ceiling(d165) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d165/3)', id as id, d165/3, ceil(d165/3) as val from dtypes;
select 'ceil(d166)', id as id, d166, ceiling(d166) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d166/3)', id as id, d166/3, ceil(d166/3) as val from dtypes;
select 'ceil(d167)', id as id, d167, ceiling(d167) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d167/3)', id as id, d167/3, ceil(d167/3) as val from dtypes;
select 'ceil(d168)', id as id, d168, ceiling(d168) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d168/3)', id as id, d168/3, ceil(d168/3) as val from dtypes;
select 'ceil(d169)', id as id, d169, ceiling(d169) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d169/3)', id as id, d169/3, ceil(d169/3) as val from dtypes;
select 'ceil(d170)', id as id, d170, ceiling(d170) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d170/3)', id as id, d170/3, ceil(d170/3) as val from dtypes;
select 'ceil(d171)', id as id, d171, ceiling(d171) from dtypes;
select 'ceil(d171/3)', id as id, d171/3, ceil(d171/3) as val from dtypes;
select 'ceil(d172)', id as id, d172, ceiling(d172) from dtypes;
select 'ceil(d172/3)', id as id, d172/3, ceil(d172/3) as val from dtypes;
select 'ceil(d173)', id as id, d173, ceiling(d173) from dtypes;
select 'ceil(d173/3)', id as id, d173/3, ceil(d173/3) as val from dtypes;
select 'ceil(d174)', id as id, d174, ceiling(d174) from dtypes;
select 'ceil(d174/3)', id as id, d174/3, ceil(d174/3) as val from dtypes;
select 'ceil(d175)', id as id, d175, ceiling(d175) from dtypes;
select 'ceil(d175/3)', id as id, d175/3, ceil(d175/3) as val from dtypes;
select 'ceil(d176)', id as id, d176, ceiling(d176) from dtypes;
select 'ceil(d176/3)', id as id, d176/3, ceil(d176/3) as val from dtypes;
select 'ceil(d177)', id as id, d177, ceiling(d177) from dtypes;
select 'ceil(d177/3)', id as id, d177/3, ceil(d177/3) as val from dtypes;
select 'ceil(d178)', id as id, d178, ceiling(d178) from dtypes;
select 'ceil(d178/3)', id as id, d178/3, ceil(d178/3) as val from dtypes;
select 'ceil(d179)', id as id, d179, ceiling(d179) from dtypes;
select 'ceil(d179/3)', id as id, d179/3, ceil(d179/3) as val from dtypes;
select 'ceil(d180)', id as id, d180, ceiling(d180) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d180/3)', id as id, d180/3, ceil(d180/3) as val from dtypes;
select 'ceil(d181)', id as id, d181, ceiling(d181) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d181/3)', id as id, d181/3, ceil(d181/3) as val from dtypes;
select 'ceil(d182)', id as id, d182, ceiling(d182) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d182/3)', id as id, d182/3, ceil(d182/3) as val from dtypes;
select 'ceil(d183)', id as id, d183, ceiling(d183) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d183/3)', id as id, d183/3, ceil(d183/3) as val from dtypes;
select 'ceil(d184)', id as id, d184, ceiling(d184) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d184/3)', id as id, d184/3, ceil(d184/3) as val from dtypes;
select 'ceil(d185)', id as id, d185, ceiling(d185) from dtypes;
# Commented out because math operation is returning NULL (bug 3352) - select 'ceil(d185/3)', id as id, d185/3, ceil(d185/3) as val from dtypes;
select 'ceil(d186)', id as id, d186, ceiling(d186) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d186/3)', id as id, d186/3, ceil(d186/3) as val from dtypes;
select 'ceil(d187)', id as id, d187, ceiling(d187) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d187/3)', id as id, d187/3, ceil(d187/3) as val from dtypes;
select 'ceil(d188)', id as id, d188, ceiling(d188) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d188/3)', id as id, d188/3, ceil(d188/3) as val from dtypes;
select 'ceil(d189)', id as id, d189, ceiling(d189) from dtypes;
# scale exceeded, moved to .scale script - select 'ceil(d189/3)', id as id, d189/3, ceil(d189/3) as val from dtypes;
#

View File

@ -0,0 +1,30 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3406.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
--exec rm -f /tmp/tmp.tbl
select *,
wide2.c19 a,
wide2.c19 b,
wide2.c19 c,
wide2.c19 d,
wide2.c19 e,
wide2.c19 f,
wide2.c19 g,
wide2.c19 h
into outfile '/tmp/tmp.tbl'
from wide2
where id <= 3000000;
--exec wc -l /tmp/tmp.tbl
--exec rm -f /tmp/tmp.tbl
#

View File

@ -0,0 +1,20 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3338.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select case substr(dtm,12,2) when '06' then 'L' when '08' then 'M' end daypart, count(*)
from dtypes group by 1 order by 1;
select case substr(dtm,12,2) when '06' then 'L' when '08' then 'M' else 'Z' end daypart, count(*)
from dtypes group by 1 order by 1;
select substr(dtm,12,2), case substr(dtm,12,2) when '06' then 'L' when '08' then 'M' end daypart, count(*)
from dtypes group by 1,2 order by 1;
select substr(dtm,12,2), case substr(dtm,12,2) when '06' then 'L' when '08' then 'M' else 'Z' end daypart, count(*)
from dtypes group by 1,2 order by 1;
#

View File

@ -0,0 +1,14 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3344.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(*) from nation where n_name is not null and n_name != 'A';
#

View File

@ -0,0 +1,15 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3381.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select avg(if(n_regionkey>0, n_nationkey, NULL)) from nation;
select r_regionkey as r, NULL as n from region union select r_regionkey, r_name from region order by 1, 2;
#

View File

@ -0,0 +1,29 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3398.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
DROP TABLE IF EXISTS bug3398_1;
DROP TABLE IF EXISTS bug3398_2;
CREATE TABLE bug3398_1 (lid int, name char(10)) engine=columnstore;
INSERT INTO bug3398_1 (lid, name) VALUES (1, 'YES'), (2, 'NO');
CREATE TABLE bug3398_2 ( id int, gid int, lid int, dt date) engine=columnstore;
INSERT INTO bug3398_2 (id, gid, lid, dt) VALUES
(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'),
(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02');
SELECT DISTINCT tt.gid AS lgid, (SELECT bug3398_1.name FROM bug3398_1, bug3398_2 WHERE bug3398_1.lid = bug3398_2.lid AND bug3398_2.gid = lgid and bug3398_1.name > 'NO' ORDER BY bug3398_2.dt) as clid FROM bug3398_2 tt ORDER BY 1;
SELECT DISTINCT bug3398_2.gid AS lgid, (SELECT bug3398_1.name FROM bug3398_1, bug3398_2 WHERE bug3398_1.lid = bug3398_2.lid AND bug3398_2.gid = lgid and bug3398_1.name > 'NO' ORDER BY bug3398_2.dt) as clid FROM bug3398_2 ORDER BY 1;
DROP TABLE bug3398_1;
DROP TABLE bug3398_2;
#

View File

@ -0,0 +1,23 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3414.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists qa_cast;
create table qa_cast ( s1 varchar(20), qaint1 int, qadouble double) engine=columnstore;
insert into qa_cast values ('123456789',123456789, 1234);
insert into qa_cast values ('123.45',123456789, 123.45);
insert into qa_cast values ('abc',123456789, 1.5);
insert into qa_cast values ('0.001',123456789, 0.001);
select s1, qaint1, mod(s1, 10), mod(qaint1, 10), mod(qadouble, 10) from qa_cast;
drop table qa_cast;
#

View File

@ -0,0 +1,36 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3436.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3436a;
drop table if exists bug3436b;
create table bug3436a (i int, j int, c1 tinyint, c2 decimal(2,1), c3 decimal(4,0), c4 decimal(4,2), c5 float, c6 double) engine=columnstore;
insert into bug3436a values (1, 1, 1, 1.1, 9991, 99.1, 1.1, 1.1), (1, 1, 2, 2.2, 9992, 99.2, 2.2, 2.2), (2, 2, 1, 1.1, 9993, 99.3, 1.1, 1.1), (2, 2, 2, 2.2, 9994, 99.4, 2.2, 2.2), (1, 1, 127, 9.1, 9995, 99.5, 127.1, 127.1), (1, 2, 100, 9.2, 9996, 99.6, 100.2, 100.2);
create table bug3436b (k int) engine=columnstore;
insert into bug3436b values (1), (2), (3);
select s/d from (select k, sum(c1) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, sum(c2) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, sum(c3) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, sum(c4) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, sum(c5) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, sum(c6) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, stddev(c1) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, stddev(c2) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, stddev(c3) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, stddev(c4) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, stddev(c5) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
select s/d from (select k, stddev(c6) s, count(distinct j) d from bug3436a join bug3436b on i=k group by 1) a order by 1;
drop table bug3436a;
drop table bug3436b;
#

View File

@ -0,0 +1,106 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3442.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists optest;
create table optest (id int, c1 date, c2 decimal(4,2), c3 date) engine=columnstore;
insert into optest values (0, '2011-01-27', null, '1999-08-25'), (1, null, null, null), (2, '2001-01-05', 2.34, null), (3, null, null, '2001-05-03');
select * from optest where (year(c1) = 2011 or c2 = 2.34) or month(c3) = 1;
select * from optest where (year(c1) = 2011 or c2 = 2.34) and month(c1) = 1;
select * from optest where year(c1) = 2011 or (c2 = 2.4) or month(c3) = 8;
select * from optest where year(c1) = 2011 or (c2 is null) or month(c1) = 2;
select * from optest where c1 is null or (c2 is null) or year(c1) = 99;
select * from optest where year(ifnull(c1, c3)) > 2000 and c2 is not null;
select * from optest where year(ifnull(c1, c3)) < 2000 or c2 is null and c3 is not null;
select * from optest where ifnull(year(c1), 2011) > 2010 or c2 is null and c3 is not null;
select * from optest where ifnull(year(c1), 2011) > 2010 or (c2 is null and c3 is not null or c2 > 2);
select * from optest where (null or year(ifnull(c1, c3)) > 2000) and ( c3 is not null or null);
select * from optest where (null or year(ifnull(c1, c3)) > 2000) or ( (c3 is not null or null) and c3 is null);
select * from optest where (null or year(ifnull(c1, c3)) > 2000) or ( (c3 is not null or null) and null);
select * from optest where (null or year(ifnull(c1, c3)) > 2000 and isnull(c2)) or ( (c3 is not null or null) and null);
select * from optest where ((null or year(ifnull(c1, c3)) > 2000) and isnull(c2)) or ( (c3 is not null or null) and null);
select * from optest where (null or c2+1 between 0 and 4 or isnull(c2)) and ( c3 is not null or null);
drop table if exists bug3442b;
create table bug3442b (
idx int,
i1 int,
i2 int,
bi1 bigint,
bi2 bigint,
d1 double,
d2 double,
f1 float,
f2 float,
c1 char(8),
c2 char(8),
vc1 varchar(20),
vc2 varchar(20),
dt1 date,
dt2 date,
dtm1 datetime,
dtm2 datetime
)engine=columnstore;
insert into bug3442b values
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, '2008-01-25', '2008-01-25', '2008-01-25 10:00', '2011-01-08 11:00'),
(2, null, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, null, '2009-01-25', '2009-01-25', '2009-01-25 10:00', '2019-01-25 11:00'),
(3, 3, null, 3, 3, 3, 3, 3, 3, 3, 3, null, 3, '2010-01-25', '2010-01-25', '2010-01-25 10:00', '2018-01-25 11:00'),
(4, 4, 4, null, 4, 4, 4, 4, 4, 4, null, 4, 4, null, '2011-01-25', '2011-01-25 10:00', '2017-01-25 11:00'),
(5, 5, 5, 5, null, 5, 5, 5, 5, null, 5, 5, 5, '2012-01-25', null, '2012-01-25 10:00', '2016-01-25 11:00'),
(6, 6, 6, 6, 6, null, 6, 6, 6, 6, 6, 6, 6, '2013-01-25', '2014-01-25', null, '2015-01-25 11:00'),
(7, 7, 7, 7, 7, 7, null, 7, 7, 7, 7, 7, 7, '2014-01-25', '2013-01-25', '2014-01-25 10:00', null),
(8, 8, 8, 8, 8, 8, 8, null, 8, 8, 8, 8, 8, '2015-01-25', '2012-01-25', '2013-01-25 10:00', '2015-01-25 11:00'),
(9, 9, 9, 9, 9, 9, 9, 9, null, 9, 9, 9, 9, '2016-01-25', '2011-01-25', '2012-01-25 10:00', '2016-01-25 11:00'),
(10, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
select 'q1', idx from bug3442b where (idx <=5 or idx is null) or (if(idx > 7, null, idx) = idx);
select 'q2', idx, bi1, dt1, dt2 from bug3442b
where (bi1 is null) or (year(dt1)<2013 or year(dt2)=2012 or dt1 is null) and (idx <= 9) and (year(dt2)<2020 or
year(dt2) is null);
select 'q3', idx, bi1, dt1, dt2 from bug3442b
where (bi1 is null) or (year(dt1)=2017 or year(dt2)=2012 or dt1 is null) and (idx <= 9) and (year(dt2)<2020 or
year(dt2) is null);
select 'q4', idx, f1, f2 from bug3442b where (f1 > 3) or (f2 < 7);
select 'q5', idx, vc1, vc2 from bug3442b where (vc1 > 1) or (vc2 > 1);
select 'q6', idx, dtm1, dtm2 from bug3442b where (year(dtm1)=2014 and month(dtm1)=1) or (year(dtm2)=2015 and
month(dtm2) <= 7);
select 'q7', idx, d1, d2, f1, f2 from bug3442b where (d1 <= d2 or f1 > f2 or f2 is null) and (idx >= 1 and (f1 < 8 or
f2 > 7));
select 'q8', idx, dtm1, dtm2 from bug3442b where hour(dtm1)=10 or hour(dtm2)=11;
select 'q9', idx from bug3442b where hour(dtm1)=10 or i1 > 2 or i2 < 5 or f1 > 6 or year(dtm2) < 2018 or vc1 < 9 or
bi2 < 4;
select 'q10', idx from bug3442b where hour(dtm1)=9 or i1 = 2 or i2 = 5 or f2 is null or f1 > 6 or year(dtm2)= 2012 or
vc1 = 9 or bi2 = 4;
drop table bug3442b;
drop table optest;
select count(*) from nation where n_nationkey < 3 OR NULL;
select count(*) from nation where n_nationkey > 0 and (n_nationkey < 3 OR NULL);
select count(*) from nation where n_nationkey > 0 and (n_nationkey < 3 OR n_nationkey is null);
select count(*) from nation where n_comment like '%ep%' and (n_comment not like '%lee%' OR null);
select count(*) from nation where n_nationkey > 0 union select count(*) from nation where n_nationkey < 3 OR NULL order by 1;
#

View File

@ -0,0 +1,20 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3443.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select (sum(case r_regionkey when 1 then r_regionkey else null end) / count(distinct (case r_regionkey when 3 then r_regionkey else null end))) s from region;
select (sum(case r_regionkey when 1 then r_regionkey else null end) / count(distinct (case r_regionkey when 3 then r_regionkey else null end))) s from region, nation where r_regionkey=n_regionkey;
select n_regionkey, (sum(case n_nationkey when 1 then n_nationkey else null end) / count(distinct (case n_nationkey when 3 then n_nationkey else null end))) s from nation group by n_regionkey order by n_regionkey;
select n_regionkey, (sum(case r_regionkey when 1 then r_regionkey else null end) / count(distinct (case r_regionkey when 3 then r_regionkey else null end))) s from region, nation where r_regionkey=n_regionkey group by n_regionkey order by n_regionkey;
#

View File

@ -0,0 +1,15 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3458.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select cidx, CAST(132.499*cidx AS DECIMAL(9,2)) from datatypetestm order by cidx;
select cidx, convert(132.499*cidx, decimal(9,2)) from datatypetestm order by cidx;
#

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3477.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select p_size from part group by p_size order by count(*) desc limit 1;
select p_size, count(*) from part group by p_size order by count(*) desc limit 1;
select p_size, count(*) from part group by p_size order by 2 desc limit 1;
select p_size, count(*) from part group by 1 order by 2 desc limit 1;
select p_size, count(*) from part group by 1 order by sum(p_size) desc limit 1;
#

View File

@ -0,0 +1,18 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3482.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select cidx, cdate from datatypetestm where ADDDATE(CDATE, INTERVAL 3 MICROSECOND) > 0;
select cidx, cdate from datatypetestm where SUBDATE(CDATE, INTERVAL 3 MICROSECOND) > 0;
select cidx, cdate from datatypetestm where TIMEDIFF(CDATE,'2007-02-28 22:23:0') > 0;
select cidx, cchar1 from datatypetestm where CONCAT(CCHAR1,CCHAR3,CCHAR7,'ALOHA') > 0 ;
#

View File

@ -0,0 +1,36 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3483.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3483;
create table bug3483 (c1 bigint, c2 decimal(18,2), c3 float, c4 double, c5 char(120), c6 varchar(120)) engine=columnstore;
insert into bug3483 values
(1, 1.1, 1.1, 1.1, '1.1', '1.1'),
(1234567890, 1234567890.1, 1234567890.1, 1234567890.1, '1234567890.1', '1234567890.1'),
(1234567890, 1234567890.8, 1234567890.8, 1234567890.8, '1234567890.8', '1234567890.8'),
(1.234567890e10, 1.2345678901e10, 1.2345678901e10, 1.2345678901e10, '1.2345678901e10', '1.2345678901e10'),
(1234567890, 1234567890123456.78, 1.2345678901e20, 1.2345678901e208, '12345678901234567890', '12345678901234567890'),
(1234567890, 1234567890987654.32, 1.2345678901e38, 1.2345678901e308, '12345678901234567890123456789012345678901234567890', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(-1, -1.1, -1.1, -1.1, '-1.1', '-1.1'),
(-1234567890, -1234567890.1, -1234567890.1, -1234567890.1, '-1234567890.1', '-1234567890.1'),
(-1234567890, -1234567890.8, -1234567890.8, -1234567890.8, '-1234567890.8', '-1234567890.8'),
(-1.234567890e10, -1.2345678901e10, -1.2345678901e10, -1.2345678901e10, '-1.2345678901e10', '-1.2345678901e10'),
(-1234567890, -1234567890123456.78, -1.2345678901e20, -1.2345678901e208, '-12345678901234567890', '-12345678901234567890'),
(-1234567890, -1234567890987654.32, -1.2345678901e38, -1.2345678901e308, '-12345678901234567890123456789012345678901234567890', '-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
select c1, ceil(c1), ceiling(c1), floor(c1), truncate(c1, 2) from bug3483;
select c2, ceil(c2), ceiling(c2), floor(c2), truncate(c2, 2) from bug3483;
select c4, ceil(c4), ceiling(c4), floor(c4) from bug3483;
select c5, ceil(c5), ceiling(c5), floor(c5), truncate(c5, 2) from bug3483;
select c6, ceil(c6), ceiling(c6), floor(c6), truncate(c6, 2) from bug3483;
drop table bug3483;
#

View File

@ -0,0 +1,20 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3484.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
set autocommit=0;
update datatypetestm set cchar255=convert(cdate,date),cvchar255=convert(cdatetime,date);
select cchar255, cvchar255 from datatypetestm;
rollback;
update datatypetestm set cidx=cidx*10, CCHAR255=DATE(CDATE) where DATE(CDATE) >0;
select cidx, cchar255 from datatypetestm;
rollback;
#

View File

@ -0,0 +1,42 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3488.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3488;
create table bug3488 (c1 bigint, c2 decimal(18,2), c3 float, c4 double, c5 char(120), c6 varchar(120)) engine=columnstore;
insert into bug3488 values
(1, 1.1, 1.1, 1.1, '1.1', '1.1'),
(1234567890, 1234567890.1, 1234567890.1, 1234567890.1, '1234567890.1', '1234567890.1'),
(1234567890, 1234567890.8, 1234567890.8, 1234567890.8, '1234567890.8', '1234567890.8'),
(1.234567890e10, 1.2345678901e10, 1.2345678901e10, 1.2345678901e10, '1.2345678901e10', '1.2345678901e10'),
(1234567890, 1234567890123456.78, 1.2345678901e20, 1.2345678901e208, '12345678901234567890', '12345678901234567890'),
(1234567890, 1234567890987654.32, 1.2345678901e38, 1.2345678901e308, '12345678901234567890123456789012345678901234567890', '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'),
(-1, -1.1, -1.1, -1.1, '-1.1', '-1.1'),
(-1234567890, -1234567890.1, -1234567890.1, -1234567890.1, '-1234567890.1', '-1234567890.1'),
(-1234567890, -1234567890.8, -1234567890.8, -1234567890.8, '-1234567890.8', '-1234567890.8'),
(-1.234567890e10, -1.2345678901e10, -1.2345678901e10, -1.2345678901e10, '-1.2345678901e10', '-1.2345678901e10'),
(-1234567890, -1234567890123456.78, -1.2345678901e20, -1.2345678901e208, '-12345678901234567890', '-12345678901234567890'),
(-1234567890, -1234567890987654.32, -1.2345678901e38, -1.2345678901e308, '-12345678901234567890123456789012345678901234567890', '-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
select c1, format(c1, -2), format(c1, 0), format(c1, 2) from bug3488;
select c2, format(c2, -2), format(c2, 0), format(c2, 2) from bug3488;
select c4, format(c4, -2), format(c4, 0), format(c4, 2) from bug3488;
select c5, format(c5, -2), format(c5, 0), format(c5, 2) from bug3488;
select c6, format(c6, -2), format(c6, 0), format(c6, 2) from bug3488;
select c1, format(c1, -2), format(c1, 0), format(c1, 2) from (select * from bug3488) sub;
select c2, format(c2, -2), format(c2, 0), format(c2, 2) from (select * from bug3488) sub;
select c4, format(c4, -2), format(c4, 0), format(c4, 2) from (select * from bug3488) sub;
select c5, format(c5, -2), format(c5, 0), format(c5, 2) from (select * from bug3488) sub;
select c6, format(c6, -2), format(c6, 0), format(c6, 2) from (select * from bug3488) sub;
drop table bug3488;
#

View File

@ -0,0 +1,62 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3492.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
select format(count(lo_orderdate), 0) num_days,
format(min(lo_orderdate), 0),
format(max(lo_orderdate), 0),
format(avg(daily_cnt), 0) avg_rows_per_day,
format(sum(daily_cnt), 0) total_rows,
format(sum(daily_cnt * d_lastdayinweekfl), 0) total_sales_last_day_in_week,
format(sum(daily_cnt * d_lastdayinmonthfl), 0) total_sales_last_day_in_month,
format(sum(daily_cnt * d_holidayfl), 0) total_sales_on_holidays,
format(sum(daily_cnt * d_weekdayfl), 0) total_weekday_sales,
format(sum(case when d_weekdayfl = 0 then daily_cnt else 0 end), 0) total_weekend_sales
from (select lo_orderdate, count(*) daily_cnt
from lineorder where lo_orderdate in (19920102,19920101,19930101) group by 1) a,
dateinfo where d_datekey = lo_orderdate;
select count(lo_orderdate) num_days,
min(lo_orderdate),
max(lo_orderdate),
avg(daily_cnt) avg_rows_per_day,
sum(daily_cnt) total_rows,
sum(daily_cnt * d_lastdayinweekfl) total_sales_last_day_in_week,
sum(daily_cnt * d_lastdayinmonthfl) total_sales_last_day_in_month,
sum(daily_cnt * d_holidayfl) total_sales_on_holidays,
sum(daily_cnt * d_weekdayfl) total_weekday_sales,
sum(case when d_weekdayfl = 0 then daily_cnt else 0 end) total_weekend_sales,
format(count(lo_orderdate), 0) num_days,
format(min(lo_orderdate), 0),
format(max(lo_orderdate), 0),
format(avg(daily_cnt), 0) avg_rows_per_day,
format(sum(daily_cnt), 0) total_rows1,
format(sum(daily_cnt * d_lastdayinweekfl), 0) total_sales_last_day_in_week,
format(sum(daily_cnt * d_lastdayinmonthfl), 0) total_sales_last_day_in_month,
format(sum(daily_cnt * d_holidayfl), 0) total_sales_on_holidays,
format(sum(daily_cnt * d_weekdayfl), 0) total_weekday_sales,
format(sum(case when d_weekdayfl = 0 then daily_cnt else 0 end), 0) total_weekend_sales
from (select lo_orderdate, count(*) daily_cnt
from lineorder where lo_orderdate in (19920102,19920101,19930101) group by 1) a,
dateinfo where d_datekey = lo_orderdate;
select count(lo_orderdate) num_days, sum(daily_cnt * d_lastdayinweekfl)
##-- ,format(cast(sum(daily_cnt * d_lastdayinweekfl) as char), 0) total_sales_last_day_in_week
from (select lo_orderdate, count(*) daily_cnt
from lineorder where lo_orderdate in (19920102,19920101,19930101) group by 1) a,
dateinfo where d_datekey = lo_orderdate;
select count(lo_orderdate) num_days, sum(daily_cnt * d_lastdayinweekfl)
,format(cast(sum(daily_cnt * d_lastdayinweekfl) as char), 0) total_sales_last_day_in_week
from (select lo_orderdate, count(*) daily_cnt
from lineorder where lo_orderdate in (19920102,19920101,19930101) group by 1) a,
dateinfo where d_datekey = lo_orderdate;
#

View File

@ -0,0 +1,121 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3496.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3496;
create table `bug3496` (`c1` int(11) default null,`c2` char(6) default null, `c3` char(11) default null) engine=columnstore;
insert into bug3496 values
(1, 'abc', 'abc'),
(2, 'abbc', 'abbc'),
(3, 'acbc', 'acbc'),
(4, 'a.c', 'a.c'),
(5, 'a[bc]d', 'a[bc]d'),
(6, 'a[]d', 'a[]d'),
(7, 'a[bcd', 'a[bcd'),
(8, 'abc]d', 'abc]d'),
(9, 'a{bc}d', 'a{bc}d'),
(10, 'a{}d', 'a{}d'),
(11, 'a{bcd', 'a{bcd'),
(12, 'abc}d', 'abc}d'),
(13, 'a(b)c', 'a(b)c'),
(14, 'a()c', 'a()c'),
(15, 'ab(bc', 'ab(bc'),
(16, 'abb)c', 'abb)c'),
(17, 'a\c', 'a\c'),
(18, 'a*bc', 'a*bc'),
(19, 'a.*c', 'a.*c'),
(20, 'a+c', 'a+c'),
(21, 'a?c', 'a?c'),
(22, 'a|c', 'a|c'),
(23, 'a^c', 'a^c'),
(24, 'a$c', 'a$c'),
(25, 'a&c', 'a&c'),
(26, 'a(b)', 'a(b)|(c)');
#-- .[{}()\*+?|^$
select c1, c2 from bug3496 where c2 like '%.%';
select c1, c2 from bug3496 where c2 like 'a.%';
select c1, c2 from bug3496 where c2 like '%[%';
select c1, c2 from bug3496 where c2 like 'a[%';
select c1, c2 from bug3496 where c2 like 'a[%';
select c1, c2 from bug3496 where c2 like 'a[bc]%';
select c1, c2 from bug3496 where c2 like 'a[%]%';
select c1, c2 from bug3496 where c2 like '%{%';
select c1, c2 from bug3496 where c2 like 'a{%';
select c1, c2 from bug3496 where c2 like '%}%';
select c1, c2 from bug3496 where c2 like 'a}%';
select c1, c2 from bug3496 where c2 like '%{%}%';
select c1, c2 from bug3496 where c2 like '%(%';
select c1, c2 from bug3496 where c2 like 'a(%';
select c1, c2 from bug3496 where c2 like '%)%';
select c1, c2 from bug3496 where c2 like 'a)%';
select c1, c2 from bug3496 where c2 like '%(%)%';
select c1, c2 from bug3496 where c2 like '%\%';
select c1, c2 from bug3496 where c2 like 'a\%';
select c1, c2 from bug3496 where c2 like '%*%';
select c1, c2 from bug3496 where c2 like 'a*%';
select c1, c2 from bug3496 where c2 like '%+%';
select c1, c2 from bug3496 where c2 like 'a+%';
select c1, c2 from bug3496 where c2 like '%?%';
select c1, c2 from bug3496 where c2 like 'a?%';
select c1, c2 from bug3496 where c2 like '%|%';
select c1, c2 from bug3496 where c2 like 'a|%';
select c1, c2 from bug3496 where c2 like '%^%';
select c1, c2 from bug3496 where c2 like 'a^%';
select c1, c2 from bug3496 where c2 like '%$%';
select c1, c2 from bug3496 where c2 like 'a$%';
select c1, c2 from bug3496 where c2 like '%&%';
select c1, c2 from bug3496 where c2 like 'a&%';
select c1, c2 from bug3496 where c2 like '%_%';
select c1, c2 from bug3496 where c2 like 'a_%';
select c1, c2 from bug3496 where c2 like 'a(b)|(c)%';
select c1, c3 from bug3496 where c3 like '%.%';
select c1, c3 from bug3496 where c3 like 'a.%';
select c1, c3 from bug3496 where c3 like '%[%';
select c1, c3 from bug3496 where c3 like 'a[%';
select c1, c3 from bug3496 where c3 like 'a[%';
select c1, c3 from bug3496 where c3 like 'a[bc]%';
select c1, c3 from bug3496 where c3 like 'a[%]%';
select c1, c3 from bug3496 where c3 like '%{%';
select c1, c3 from bug3496 where c3 like 'a{%';
select c1, c3 from bug3496 where c3 like '%}%';
select c1, c3 from bug3496 where c3 like 'a}%';
select c1, c3 from bug3496 where c3 like '%{%}%';
select c1, c3 from bug3496 where c3 like '%(%';
select c1, c3 from bug3496 where c3 like 'a(%';
select c1, c3 from bug3496 where c3 like '%)%';
select c1, c3 from bug3496 where c3 like 'a)%';
select c1, c3 from bug3496 where c3 like '%(%)%';
select c1, c3 from bug3496 where c3 like '%\%';
select c1, c3 from bug3496 where c3 like 'a\%';
select c1, c3 from bug3496 where c3 like '%*%';
select c1, c3 from bug3496 where c3 like 'a*%';
select c1, c3 from bug3496 where c3 like '%+%';
select c1, c3 from bug3496 where c3 like 'a+%';
select c1, c3 from bug3496 where c3 like '%?%';
select c1, c3 from bug3496 where c3 like 'a?%';
select c1, c3 from bug3496 where c3 like '%|%';
select c1, c3 from bug3496 where c3 like 'a|%';
select c1, c3 from bug3496 where c3 like '%^%';
select c1, c3 from bug3496 where c3 like 'a^%';
select c1, c3 from bug3496 where c3 like '%$%';
select c1, c3 from bug3496 where c3 like 'a$%';
select c1, c3 from bug3496 where c3 like '%&%';
select c1, c3 from bug3496 where c3 like 'a&%';
select c1, c3 from bug3496 where c3 like '%_%';
select c1, c3 from bug3496 where c3 like 'a_%';
select c1, c3 from bug3496 where c3 like 'a(b)|(c)%';
drop table bug3496;
#

View File

@ -0,0 +1,51 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3497.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3497a;
drop table if exists bug3497b;
CREATE TABLE bug3497a (col1 int, col2 varchar(10)) engine=columnstore;
INSERT INTO bug3497a VALUES(1,'trudy');
INSERT INTO bug3497a VALUES(2,'peter');
INSERT INTO bug3497a VALUES(3,'sanja');
INSERT INTO bug3497a VALUES(4,'monty');
INSERT INTO bug3497a VALUES(5,'david');
INSERT INTO bug3497a VALUES(6,'kent');
INSERT INTO bug3497a VALUES(7,'carsten');
INSERT INTO bug3497a VALUES(8,'ranger');
INSERT INTO bug3497a VALUES(10,'matt');
CREATE TABLE bug3497b (col1 int, col2 int, col3 char(1)) engine=columnstore;
INSERT INTO bug3497b VALUES (1,1,'y');
INSERT INTO bug3497b VALUES (1,2,'y');
INSERT INTO bug3497b VALUES (2,1,'n');
INSERT INTO bug3497b VALUES (3,1,'n');
INSERT INTO bug3497b VALUES (4,1,'y');
INSERT INTO bug3497b VALUES (4,2,'n');
INSERT INTO bug3497b VALUES (4,3,'n');
INSERT INTO bug3497b VALUES (6,1,'n');
INSERT INTO bug3497b VALUES (8,1,'y');
SELECT a.col1,a.col2,b.col2,b.col3 FROM bug3497b b RIGHT JOIN bug3497a a ON
a.col1=b.col1 WHERE a.col1 IN (1,5,9) AND b.col2=(SELECT MAX(col2) FROM bug3497b b2
WHERE b2.col1=b.col1) order by 1, 2;
SELECT distinct a.col1,a.col2,b.col2,b.col3 FROM bug3497b b RIGHT JOIN bug3497a a ON
a.col1=b.col1 WHERE b.col2=(SELECT MAX(col2) FROM bug3497b b2 WHERE b2.col1=b.col1)
order by 1, 2;
SELECT a.col1,a.col2,b.col2,b.col3 FROM bug3497b b RIGHT JOIN bug3497a a ON
a.col1=b.col1 WHERE b.col1 IN (1,5,9) AND b.col2=(SELECT MAX(col2) FROM bug3497b b2
WHERE b2.col1=b.col1) order by 1, 2;
drop table if exists bug3497a;
drop table if exists bug3497b;
#

View File

@ -0,0 +1,26 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3506.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select rand(0) from region;
select rand(-2) from region order by 1;
select rand(2) from region order by rand(1);
select * from (select n_nationkey, rand(1) from nation limit 1) x;
select * from (select n_nationkey from nation order by rand(1) limit 1 )a;
select rand(r_regionkey) from region;
select rand(r_name) from region;
#-- should test the following to make sure rand() without arg returns random value each time.
#-- comment out for regression test because it'll never compare
#-- select * from (select n_nationkey from nation order by rand() limit 1 ) a;
#-- select n_nationkey from nation order by rand() limit 1;
#

View File

@ -0,0 +1,18 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3509.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
# 2013-02-06. Commented out first two queries. They are corner cases that no longer match with changes made for license compliance.
#select 'A' A, conv(d_datekey,10,2), 'B' B from dateinfo where d_datekey = 19980404;
#select 'A' A,MD5(d_datekey), 'B' B from dateinfo where d_datekey = 19980404;
select 'A' A,REVERSE(d_datekey), 'B' B from dateinfo where d_datekey = 19980404;
select 'A' A,REVERSE(d_datekey), md5(d_datekey) from dateinfo where d_datekey = 19980404;
#

View File

@ -0,0 +1,107 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3518.negative.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
--disable_warnings
drop table if exists qa_dict_join_1;
drop table if exists qa_dict_join_2;
--enable_warnings
Create table qa_dict_join_1 (
CIDX INTEGER,
CBIGINT BIGINT,
CDECIMAL1 DECIMAL(1),
CDECIMAL4 DECIMAL(4),
CDECIMAL4_2 DECIMAL(4,2),
CDECIMAL5 DECIMAL(5),
CDECIMAL9 DECIMAL(9),
CDECIMAL9_2 DECIMAL(9,2),
CDECIMAL10 DECIMAL(10),
CDECIMAL18 DECIMAL(18),
CDECIMAL18_2 DECIMAL(18,2),
CINTEGER INTEGER,
CSMALLINT SMALLINT,
CTINYINT TINYINT,
CDATE DATE,
CDATETIME DATETIME,
CCHAR1 CHAR(1),
CCHAR2 CHAR(2),
CCHAR3 CHAR(3),
CCHAR4 CHAR(4),
CCHAR5 CHAR(5),
CCHAR6 CHAR(6),
CCHAR7 CHAR(7),
CCHAR8 CHAR(8),
CCHAR9 CHAR(9),
CCHAR255 CHAR(255),
CVCHAR1 VARCHAR(1),
CVCHAR2 VARCHAR(2),
CVCHAR3 VARCHAR(3),
CVCHAR4 VARCHAR(4),
CVCHAR5 VARCHAR(5),
CVCHAR6 VARCHAR(6),
CVCHAR7 VARCHAR(7),
CVCHAR8 VARCHAR(8),
CVCHAR255 VARCHAR(255)
) engine=columnstore;
insert into qa_dict_join_1 values (1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
insert into qa_dict_join_1 values (2,0,0,0,0,0,0,0,0,0,0,0,0,0,'1000-01-01','1000-01-01 00:00:00',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
insert into qa_dict_join_1 values (3,0,-9,-9999,-99.99,-99999,-999999999,-9999999.99,-9999999999,-999999999999999999,-9999999999999999.99,-2147483646,-32766,-126,'1000-01-01','1000-01-01 00:00:00','a','aa','aaa','aaaa','aaaaa','aaaaaa','aaaaaaa','aaaaaaaa','aaaaaaaa','aaaaaaaaaa','a','aa','aaa','aaaa','aaaaa','aaaaaa','aaaaaaa','aaaaaaaa','aaaaaaaaaa');
Create table qa_dict_join_2 (
CIDX INTEGER,
CBIGINT BIGINT,
CDECIMAL1 DECIMAL(1),
CDECIMAL4 DECIMAL(4),
CDECIMAL4_2 DECIMAL(4,2),
CDECIMAL5 DECIMAL(5),
CDECIMAL9 DECIMAL(9),
CDECIMAL9_2 DECIMAL(9,2),
CDECIMAL10 DECIMAL(10),
CDECIMAL18 DECIMAL(18),
CDECIMAL18_2 DECIMAL(18,2),
CINTEGER INTEGER,
CSMALLINT SMALLINT,
CTINYINT TINYINT,
CDATE DATE,
CDATETIME DATETIME,
CCHAR1 CHAR(1),
CCHAR2 CHAR(2),
CCHAR3 CHAR(3),
CCHAR4 CHAR(4),
CCHAR5 CHAR(5),
CCHAR6 CHAR(6),
CCHAR7 CHAR(7),
CCHAR8 CHAR(8),
CCHAR9 CHAR(9),
CCHAR255 CHAR(255),
CVCHAR1 VARCHAR(1),
CVCHAR2 VARCHAR(2),
CVCHAR3 VARCHAR(3),
CVCHAR4 VARCHAR(4),
CVCHAR5 VARCHAR(5),
CVCHAR6 VARCHAR(6),
CVCHAR7 VARCHAR(7),
CVCHAR8 VARCHAR(8),
CVCHAR255 VARCHAR(255)
) engine=columnstore;
insert into qa_dict_join_2 values (1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
insert into qa_dict_join_2 values (2,0,0,0,0,0,0,0,0,0,0,0,0,0,'1000-01-01','1000-01-01 00:00:00',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
insert into qa_dict_join_2 values (3,0,-9,-9999,-99.99,-99999,-999999999,-9999999.99,-9999999999,-999999999999999999,-9999999999999999.99,-2147483646,-32766,-126,'1000-01-01','1000-01-01 00:00:00','a','aa','aaa','aaaa','aaaaa','aaaaaa','aaaaaaa','aaaaaaaa','aaaaaaaa','aaaaaaaaaa','a','aa','aaa','aaaa','aaaaa','aaaaaa','aaaaaaa','aaaaaaaa','aaaaaaaaaa');
select a.cidx, b.cidx from qa_dict_join_1 a, qa_dict_join_2 b where a.CBIGINT = b.CBIGINT order by a.cidx, b.cidx;
select b.cidx from qa_dict_join_1 a, qa_dict_join_2 b where a.CBIGINT = b.CBIGINT order by a.cidx, b.cidx;
select a.cidx, b.cidx from qa_dict_join_1 a, qa_dict_join_2 b where a.CBIGINT = b.CBIGINT order by abs(a.cidx), abs(b.cidx);
select abs(a.cidx), b.cidx from qa_dict_join_1 a, qa_dict_join_2 b where a.CBIGINT = b.CBIGINT order by a.cidx, b.cidx;
#
drop table if exists qa_dict_join_1;
drop table if exists qa_dict_join_2;
#

View File

@ -0,0 +1,43 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3520.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE ssb1;
#
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
select lo_orderkey into outfile '/tmp/bug3520.txt' from (select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1 union all select lo_orderkey from lineorder group by 1) x;
--exec rm -f /tmp/bug3520.txt
#

View File

@ -0,0 +1,67 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3522.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select
count(distinct c1) c1,
count(distinct c2) c2,
count(distinct c3) c3,
count(distinct c4) c4,
count(distinct c5) c5,
count(distinct c6) c6,
count(distinct c7) c7,
count(distinct c8) c8,
count(distinct c9) c9,
count(distinct c10) c10,
count(distinct c11) c11,
count(distinct c12) c12,
count(distinct c13) c13,
count(distinct c14) c14,
count(distinct c15) c15,
count(distinct c16) c16,
count(distinct c17) c17,
count(distinct c18) c18,
count(distinct c19) c19,
count(distinct c20) c20,
count(distinct c21) c21,
count(distinct c22) c22,
count(distinct c23) c23,
count(distinct c24) c24,
count(distinct c25) c25,
count(distinct c26) c26,
count(distinct c27) c27,
count(distinct c28) c28,
count(distinct c29) c29,
count(distinct c30) c30,
count(distinct c31) c31,
count(distinct c32) c32,
count(distinct c33) c33,
count(distinct c34) c34,
count(distinct c35) c35,
count(distinct c36) c36,
count(distinct c37) c37,
count(distinct c38) c38,
count(distinct c39) c39,
count(distinct c40) c40,
count(distinct c41) c41,
count(distinct c42) c42,
count(distinct c43) c43,
count(distinct c44) c44,
count(distinct c45) c45,
count(distinct c46) c46,
count(distinct c47) c47,
count(distinct c48) c48,
count(distinct c49) c49,
count(distinct c50) c50
from wide
where idx = 99;
#

View File

@ -0,0 +1,19 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3523.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select count(*) from (select n_regionkey, n_nationkey, count(*) c from nation group by 1, 2) n;
select sum(c+0) from (select n_regionkey, n_nationkey, count(*) c from nation group by 1, 2) n;
select count(*),sum(c) from (select n_regionkey,n_nationkey, count(*) c from nation group by 1,2) n;
select count(*), sum(c+0) from (select n_regionkey, n_nationkey, count(*) c from nation group by 1, 2) n;
select sum(1) T, sum(if(F=1,1,0)) "1", sum(if(F>=2,1,0)) "2+" from (select n_nationkey, n_regionkey, least(3, count(*)) F from nation group by 1, 2) a;
select sum(1) T, sum(if(F=1,1,0)) "1", sum(if(F=2,1,0)) "2", sum(if(F>=3,1,0)) "3+" from (select n_nationkey, n_regionkey, least(3, count(*)+n_regionkey) F from nation group by 1, 2) a;
#

View File

@ -0,0 +1,37 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3524.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists a1;
drop table if exists a2;
create table a1 (c1 int, c2 int)engine=columnstore;
create table a2 (c1 int, c2 int)engine=columnstore;
insert into a1 values (1, 1),(2,2),(3,null),(null,3),(null,null);
insert into a2 values (1, 1),(2, null),(null, 2),(3, 3),(null, null);
select * from a1 where c1 not in (select c2 from a2);
select * from a1 where c1 not in (select c2 from a2 where a1.c2=a2.c2);
select * from a1 where not exists (select c2 from a2 where a1.c2=a2.c2 and a1.c1=a2.c1);
select * from a1 where not exists (select c2 from a2 where a1.c2=a2.c2);
#-- failed to compare because of bug2810 not fixed yet
#-- select * from a1 where (c1,c2) not in (select c1,c2 from a2);
#-- failed to compare because of bug2810 not fixed yet
#-- select * from a1 where (c1,c2) not in (select c1,c2 from a2 where a2.c1 = a1.c2);
select * from a1 where (c1,c2) not in (select c1,c2 from a2 where a2.c1 > a1.c2);
select * from a1 where c1 not in (select c2 from a2 where a1.c2>a2.c2);
select * from a1 where c1 not in (select 1 from a2 where a1.c1=a2.c1);
select count(*) from a1 where c1 not in (select c2 from a2 where a1.c2=a2.c2);
select count(*) from a1 where not exists (select c2 from a2 where a1.c2=a2.c2 and a1.c1=a2.c1);
drop table a1;
drop table a2;
#

View File

@ -0,0 +1,18 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3532.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
drop table if exists bug3532;
create table `bug3532` (`c1` char(1) default null, `c2` int(11) default null) engine=columnstore;
insert into bug3532 values (1,1), (0,0), (1,12), (1,-1), (null, null);
select round(c1,c1) from bug3532 where c1 = 1;
drop table bug3532;
#

View File

@ -0,0 +1,179 @@
# -------------------------------------------------------------- #
# Test case migrated from regression test suite: bug3554.sql
#
# Author: Daniel Lee, daniel.lee@mariadb.com
# -------------------------------------------------------------- #
#
--source ../include/have_columnstore.inc
#
USE tpch1;
#
select avg(id), min(id), max(id), (100/1000000) * avg(id) avg2, 0.0001 * min(id) min2, max(id)/10000 max2 from dtypes;
select avg(f), min(f), max(f), (100/1000000) * avg(f) avg2, 0.0001 * min(f) min2, max(f)/10000 max2 from dtypes;
select avg(db), min(db), max(db), (100/1000000) * avg(db) avg2, 0.0001 * min(db) min2, max(db)/10000 max2 from dtypes;
select avg(ti), min(ti), max(ti), (100/1000000) * avg(ti) avg2, 0.0001 * min(ti) min2, max(ti)/10000 max2 from dtypes;
select avg(si), min(si), max(si), (100/1000000) * avg(si) avg2, 0.0001 * min(si) min2, max(si)/10000 max2 from dtypes;
select avg(i), min(i), max(i), (100/1000000) * avg(i) avg2, 0.0001 * min(i) min2, max(i)/10000 max2 from dtypes;
select avg(bi), min(bi), max(bi), (100/1000000) * avg(bi) avg2, 0.0001 * min(bi) min2, max(bi)/10000 max2 from dtypes;
select avg(d1), min(d1), max(d1), count(d1), (100/1000000) * avg(d1) avg2, 0.0001 * min(d1) min2, max(d1)/10000 max2 from dtypes;
select d1 from dtypes;
select avg(d2), min(d2), max(d2), (100/1000000) * avg(d2) avg2, 0.0001 * min(d2) min2, max(d2)/10000 max2 from dtypes;
select avg(d3), min(d3), max(d3), count(d3), (100/1000000) * avg(d3) avg2, 0.0001 * min(d3) min2, max(d3)/10000 max2 from dtypes;
select d3 from dtypes;
select avg(d4), min(d4), max(d4), (100/1000000) * avg(d4) avg2, 0.0001 * min(d4) min2, max(d4)/10000 max2 from dtypes;
select avg(d5), min(d5), max(d5), (100/1000000) * avg(d5) avg2, 0.0001 * min(d5) min2, max(d5)/10000 max2 from dtypes;
select avg(d6), min(d6), max(d6), (100/1000000) * avg(d6) avg2, 0.0001 * min(d6) min2, max(d6)/10000 max2 from dtypes;
select avg(d7), min(d7), max(d7), (100/1000000) * avg(d7) avg2, 0.0001 * min(d7) min2, max(d7)/10000 max2 from dtypes;
select avg(d8), min(d8), max(d8), (100/1000000) * avg(d8) avg2, 0.0001 * min(d8) min2, max(d8)/10000 max2 from dtypes;
select avg(d9), min(d9), max(d9), (100/1000000) * avg(d9) avg2, 0.0001 * min(d9) min2, max(d9)/10000 max2 from dtypes;
select avg(d10), min(d10), max(d10), (100/1000000) * avg(d10) avg2, 0.0001 * min(d10) min2, max(d10)/10000 max2 from dtypes;
select avg(d11), min(d11), max(d11), (100/1000000) * avg(d11) avg2, 0.0001 * min(d11) min2, max(d11)/10000 max2 from dtypes;
select avg(d12), min(d12), max(d12), (100/1000000) * avg(d12) avg2, 0.0001 * min(d12) min2, max(d12)/10000 max2 from dtypes;
select avg(d13), min(d13), max(d13), (100/1000000) * avg(d13) avg2, 0.0001 * min(d13) min2, max(d13)/10000 max2 from dtypes;
select avg(d14), min(d14), max(d14), (100/1000000) * avg(d14) avg2, 0.0001 * min(d14) min2, max(d14)/10000 max2 from dtypes;
select avg(d15), min(d15), max(d15), (100/1000000) * avg(d15) avg2, 0.0001 * min(d15) min2, max(d15)/10000 max2 from dtypes;
select avg(d16), min(d16), max(d16), (100/1000000) * avg(d16) avg2, 0.0001 * min(d16) min2, max(d16)/10000 max2 from dtypes;
select avg(d17), min(d17), max(d17), (100/1000000) * avg(d17) avg2, 0.0001 * min(d17) min2, max(d17)/10000 max2 from dtypes;
select avg(d18), min(d18), max(d18), (100/1000000) * avg(d18) avg2, 0.0001 * min(d18) min2, max(d18)/10000 max2 from dtypes;
select avg(d19), min(d19), max(d19), (100/1000000) * avg(d19) avg2, 0.0001 * min(d19) min2, max(d19)/10000 max2 from dtypes;
select avg(d20), min(d20), max(d20), (100/1000000) * avg(d20) avg2, 0.0001 * min(d20) min2, max(d20)/10000 max2 from dtypes;
select avg(d21), min(d21), max(d21), (100/1000000) * avg(d21) avg2, 0.0001 * min(d21) min2, max(d21)/10000 max2 from dtypes;
select avg(d22), min(d22), max(d22), (100/1000000) * avg(d22) avg2, 0.0001 * min(d22) min2, max(d22)/10000 max2 from dtypes;
select avg(d23), min(d23), max(d23), (100/1000000) * avg(d23) avg2, 0.0001 * min(d23) min2, max(d23)/10000 max2 from dtypes;
select avg(d24), min(d24), max(d24), (100/1000000) * avg(d24) avg2, 0.0001 * min(d24) min2, max(d24)/10000 max2 from dtypes;
select avg(d25), min(d25), max(d25), (100/1000000) * avg(d25) avg2, 0.0001 * min(d25) min2, max(d25)/10000 max2 from dtypes;
select avg(d26), min(d26), max(d26), (100/1000000) * avg(d26) avg2, 0.0001 * min(d26) min2, max(d26)/10000 max2 from dtypes;
select avg(d27), min(d27), max(d27), (100/1000000) * avg(d27) avg2, 0.0001 * min(d27) min2, max(d27)/10000 max2 from dtypes;
select avg(d28), min(d28), max(d28), (100/1000000) * avg(d28) avg2, 0.0001 * min(d28) min2, max(d28)/10000 max2 from dtypes;
select avg(d29), min(d29), max(d29), (100/1000000) * avg(d29) avg2, 0.0001 * min(d29) min2, max(d29)/10000 max2 from dtypes;
select avg(d30), min(d30), max(d30), (100/1000000) * avg(d30) avg2, 0.0001 * min(d30) min2, max(d30)/10000 max2 from dtypes;
select avg(d31), min(d31), max(d31), (100/1000000) * avg(d31) avg2, 0.0001 * min(d31) min2, max(d31)/10000 max2 from dtypes;
select avg(d32), min(d32), max(d32), (100/1000000) * avg(d32) avg2, 0.0001 * min(d32) min2, max(d32)/10000 max2 from dtypes;
select avg(d33), min(d33), max(d33), (100/1000000) * avg(d33) avg2, 0.0001 * min(d33) min2, max(d33)/10000 max2 from dtypes;
select avg(d34), min(d34), max(d34), (100/1000000) * avg(d34) avg2, 0.0001 * min(d34) min2, max(d34)/10000 max2 from dtypes;
select avg(d35), min(d35), max(d35), (100/1000000) * avg(d35) avg2, 0.0001 * min(d35) min2, max(d35)/10000 max2 from dtypes;
select avg(d36), min(d36), max(d36), (100/1000000) * avg(d36) avg2, 0.0001 * min(d36) min2, max(d36)/10000 max2 from dtypes;
select avg(d37), min(d37), max(d37), (100/1000000) * avg(d37) avg2, 0.0001 * min(d37) min2, max(d37)/10000 max2 from dtypes;
select avg(d38), min(d38), max(d38), (100/1000000) * avg(d38) avg2, 0.0001 * min(d38) min2, max(d38)/10000 max2 from dtypes;
select avg(d39), min(d39), max(d39), (100/1000000) * avg(d39) avg2, 0.0001 * min(d39) min2, max(d39)/10000 max2 from dtypes;
select avg(d40), min(d40), max(d40), (100/1000000) * avg(d40) avg2, 0.0001 * min(d40) min2, max(d40)/10000 max2 from dtypes;
select avg(d41), min(d41), max(d41), (100/1000000) * avg(d41) avg2, 0.0001 * min(d41) min2, max(d41)/10000 max2 from dtypes;
select avg(d42), min(d42), max(d42), (100/1000000) * avg(d42) avg2, 0.0001 * min(d42) min2, max(d42)/10000 max2 from dtypes;
select avg(d43), min(d43), max(d43), (100/1000000) * avg(d43) avg2, 0.0001 * min(d43) min2, max(d43)/10000 max2 from dtypes;
select avg(d44), min(d44), max(d44), (100/1000000) * avg(d44) avg2, 0.0001 * min(d44) min2, max(d44)/10000 max2 from dtypes;
select avg(d45), min(d45), max(d45), (100/1000000) * avg(d45) avg2, 0.0001 * min(d45) min2, max(d45)/10000 max2 from dtypes;
select avg(d46), min(d46), max(d46), (100/1000000) * avg(d46) avg2, 0.0001 * min(d46) min2, max(d46)/10000 max2 from dtypes;
select avg(d47), min(d47), max(d47), (100/1000000) * avg(d47) avg2, 0.0001 * min(d47) min2, max(d47)/10000 max2 from dtypes;
select avg(d48), min(d48), max(d48), (100/1000000) * avg(d48) avg2, 0.0001 * min(d48) min2, max(d48)/10000 max2 from dtypes;
select avg(d49), min(d49), max(d49), (100/1000000) * avg(d49) avg2, 0.0001 * min(d49) min2, max(d49)/10000 max2 from dtypes;
select avg(d50), min(d50), max(d50), (100/1000000) * avg(d50) avg2, 0.0001 * min(d50) min2, max(d50)/10000 max2 from dtypes;
select avg(d51), min(d51), max(d51), (100/1000000) * avg(d51) avg2, 0.0001 * min(d51) min2, max(d51)/10000 max2 from dtypes;
select avg(d52), min(d52), max(d52), (100/1000000) * avg(d52) avg2, 0.0001 * min(d52) min2, max(d52)/10000 max2 from dtypes;
select avg(d53), min(d53), max(d53), (100/1000000) * avg(d53) avg2, 0.0001 * min(d53) min2, max(d53)/10000 max2 from dtypes;
select avg(d54), min(d54), max(d54), (100/1000000) * avg(d54) avg2, 0.0001 * min(d54) min2, max(d54)/10000 max2 from dtypes;
select avg(d55), min(d55), max(d55), (100/1000000) * avg(d55) avg2, 0.0001 * min(d55) min2, max(d55)/10000 max2 from dtypes;
select avg(d56), min(d56), max(d56), (100/1000000) * avg(d56) avg2, 0.0001 * min(d56) min2, max(d56)/10000 max2 from dtypes;
select avg(d57), min(d57), max(d57), (100/1000000) * avg(d57) avg2, 0.0001 * min(d57) min2, max(d57)/10000 max2 from dtypes;
select avg(d58), min(d58), max(d58), (100/1000000) * avg(d58) avg2, 0.0001 * min(d58) min2, max(d58)/10000 max2 from dtypes;
select avg(d59), min(d59), max(d59), (100/1000000) * avg(d59) avg2, 0.0001 * min(d59) min2, max(d59)/10000 max2 from dtypes;
select avg(d60), min(d60), max(d60), (100/1000000) * avg(d60) avg2, 0.0001 * min(d60) min2, max(d60)/10000 max2 from dtypes;
select avg(d61), min(d61), max(d61), (100/1000000) * avg(d61) avg2, 0.0001 * min(d61) min2, max(d61)/10000 max2 from dtypes;
select avg(d62), min(d62), max(d62), (100/1000000) * avg(d62) avg2, 0.0001 * min(d62) min2, max(d62)/10000 max2 from dtypes;
select avg(d63), min(d63), max(d63), (100/1000000) * avg(d63) avg2, 0.0001 * min(d63) min2, max(d63)/10000 max2 from dtypes;
select avg(d64), min(d64), max(d64), (100/1000000) * avg(d64) avg2, 0.0001 * min(d64) min2, max(d64)/10000 max2 from dtypes;
select avg(d65), min(d65), max(d65), (100/1000000) * avg(d65) avg2, 0.0001 * min(d65) min2, max(d65)/10000 max2 from dtypes;
select avg(d66), min(d66), max(d66), (100/1000000) * avg(d66) avg2, 0.0001 * min(d66) min2, max(d66)/10000 max2 from dtypes;
select avg(d67), min(d67), max(d67), (100/1000000) * avg(d67) avg2, 0.0001 * min(d67) min2, max(d67)/10000 max2 from dtypes;
select avg(d68), min(d68), max(d68), (100/1000000) * avg(d68) avg2, 0.0001 * min(d68) min2, max(d68)/10000 max2 from dtypes;
select avg(d69), min(d69), max(d69), (100/1000000) * avg(d69) avg2, 0.0001 * min(d69) min2, max(d69)/10000 max2 from dtypes;
select avg(d70), min(d70), max(d70), (100/1000000) * avg(d70) avg2, 0.0001 * min(d70) min2, max(d70)/10000 max2 from dtypes;
select avg(d71), min(d71), max(d71), (100/1000000) * avg(d71) avg2, 0.0001 * min(d71) min2, max(d71)/10000 max2 from dtypes;
select avg(d72), min(d72), max(d72), (100/1000000) * avg(d72) avg2, 0.0001 * min(d72) min2, max(d72)/10000 max2 from dtypes;
select avg(d73), min(d73), max(d73), (100/1000000) * avg(d73) avg2, 0.0001 * min(d73) min2, max(d73)/10000 max2 from dtypes;
select avg(d74), min(d74), max(d74), (100/1000000) * avg(d74) avg2, 0.0001 * min(d74) min2, max(d74)/10000 max2 from dtypes;
select avg(d75), min(d75), max(d75), (100/1000000) * avg(d75) avg2, 0.0001 * min(d75) min2, max(d75)/10000 max2 from dtypes;
select avg(d76), min(d76), max(d76), (100/1000000) * avg(d76) avg2, 0.0001 * min(d76) min2, max(d76)/10000 max2 from dtypes;
select avg(d77), min(d77), max(d77), (100/1000000) * avg(d77) avg2, 0.0001 * min(d77) min2, max(d77)/10000 max2 from dtypes;
select avg(d78), min(d78), max(d78), (100/1000000) * avg(d78) avg2, 0.0001 * min(d78) min2, max(d78)/10000 max2 from dtypes;
select avg(d79), min(d79), max(d79), (100/1000000) * avg(d79) avg2, 0.0001 * min(d79) min2, max(d79)/10000 max2 from dtypes;
select avg(d80), min(d80), max(d80), (100/1000000) * avg(d80) avg2, 0.0001 * min(d80) min2, max(d80)/10000 max2 from dtypes;
select avg(d81), min(d81), max(d81), (100/1000000) * avg(d81) avg2, 0.0001 * min(d81) min2, max(d81)/10000 max2 from dtypes;
select avg(d82), min(d82), max(d82), (100/1000000) * avg(d82) avg2, 0.0001 * min(d82) min2, max(d82)/10000 max2 from dtypes;
select avg(d83), min(d83), max(d83), (100/1000000) * avg(d83) avg2, 0.0001 * min(d83) min2, max(d83)/10000 max2 from dtypes;
select avg(d84), min(d84), max(d84), (100/1000000) * avg(d84) avg2, 0.0001 * min(d84) min2, max(d84)/10000 max2 from dtypes;
select avg(d85), min(d85), max(d85), (100/1000000) * avg(d85) avg2, 0.0001 * min(d85) min2, max(d85)/10000 max2 from dtypes;
select avg(d86), min(d86), max(d86), (100/1000000) * avg(d86) avg2, 0.0001 * min(d86) min2, max(d86)/10000 max2 from dtypes;
select avg(d87), min(d87), max(d87), (100/1000000) * avg(d87) avg2, 0.0001 * min(d87) min2, max(d87)/10000 max2 from dtypes;
select avg(d88), min(d88), max(d88), (100/1000000) * avg(d88) avg2, 0.0001 * min(d88) min2, max(d88)/10000 max2 from dtypes;
select avg(d89), min(d89), max(d89), (100/1000000) * avg(d89) avg2, 0.0001 * min(d89) min2, max(d89)/10000 max2 from dtypes;
select avg(d90), min(d90), max(d90), (100/1000000) * avg(d90) avg2, 0.0001 * min(d90) min2, max(d90)/10000 max2 from dtypes;
select avg(d91), min(d91), max(d91), (100/1000000) * avg(d91) avg2, 0.0001 * min(d91) min2, max(d91)/10000 max2 from dtypes;
select avg(d92), min(d92), max(d92), (100/1000000) * avg(d92) avg2, 0.0001 * min(d92) min2, max(d92)/10000 max2 from dtypes;
select avg(d93), min(d93), max(d93), (100/1000000) * avg(d93) avg2, 0.0001 * min(d93) min2, max(d93)/10000 max2 from dtypes;
select avg(d94), min(d94), max(d94), (100/1000000) * avg(d94) avg2, 0.0001 * min(d94) min2, max(d94)/10000 max2 from dtypes;
select avg(d95), min(d95), max(d95), (100/1000000) * avg(d95) avg2, 0.0001 * min(d95) min2, max(d95)/10000 max2 from dtypes;
select avg(d96), min(d96), max(d96), (100/1000000) * avg(d96) avg2, 0.0001 * min(d96) min2, max(d96)/10000 max2 from dtypes;
select avg(d97), min(d97), max(d97), (100/1000000) * avg(d97) avg2, 0.0001 * min(d97) min2, max(d97)/10000 max2 from dtypes;
select avg(d98), min(d98), max(d98), (100/1000000) * avg(d98) avg2, 0.0001 * min(d98) min2, max(d98)/10000 max2 from dtypes;
select avg(d99), min(d99), max(d99), (100/1000000) * avg(d99) avg2, 0.0001 * min(d99) min2, max(d99)/10000 max2 from dtypes;
select avg(d100), min(d100), max(d100), (100/1000000) * avg(d100) avg2, 0.0001 * min(d100) min2, max(d100)/10000 max2 from dtypes;
select avg(d101), min(d101), max(d101), (100/1000000) * avg(d101) avg2, 0.0001 * min(d101) min2, max(d101)/10000 max2 from dtypes;
select avg(d102), min(d102), max(d102), (100/1000000) * avg(d102) avg2, 0.0001 * min(d102) min2, max(d102)/10000 max2 from dtypes;
select avg(d103), min(d103), max(d103), (100/1000000) * avg(d103) avg2, 0.0001 * min(d103) min2, max(d103)/10000 max2 from dtypes;
select avg(d104), min(d104), max(d104), (100/1000000) * avg(d104) avg2, 0.0001 * min(d104) min2, max(d104)/10000 max2 from dtypes;
select avg(d105), min(d105), max(d105), (100/1000000) * avg(d105) avg2, 0.0001 * min(d105) min2, max(d105)/10000 max2 from dtypes;
select avg(d106), min(d106), max(d106), (100/1000000) * avg(d106) avg2, 0.0001 * min(d106) min2, max(d106)/10000 max2 from dtypes;
select avg(d107), min(d107), max(d107), (100/1000000) * avg(d107) avg2, 0.0001 * min(d107) min2, max(d107)/10000 max2 from dtypes;
select avg(d108), min(d108), max(d108), (100/1000000) * avg(d108) avg2, 0.0001 * min(d108) min2, max(d108)/10000 max2 from dtypes;
select avg(d109), min(d109), max(d109), (100/1000000) * avg(d109) avg2, 0.0001 * min(d109) min2, max(d109)/10000 max2 from dtypes;
select avg(d110), min(d110), max(d110), (100/1000000) * avg(d110) avg2, 0.0001 * min(d110) min2, max(d110)/10000 max2 from dtypes;
select avg(d111), min(d111), max(d111), (100/1000000) * avg(d111) avg2, 0.0001 * min(d111) min2, max(d111)/10000 max2 from dtypes;
select avg(d112), min(d112), max(d112), (100/1000000) * avg(d112) avg2, 0.0001 * min(d112) min2, max(d112)/10000 max2 from dtypes;
select avg(d113), min(d113), max(d113), (100/1000000) * avg(d113) avg2, 0.0001 * min(d113) min2, max(d113)/10000 max2 from dtypes;
select avg(d114), min(d114), max(d114), (100/1000000) * avg(d114) avg2, 0.0001 * min(d114) min2, max(d114)/10000 max2 from dtypes;
select avg(d115), min(d115), max(d115), (100/1000000) * avg(d115) avg2, 0.0001 * min(d115) min2, max(d115)/10000 max2 from dtypes;
select avg(d116), min(d116), max(d116), (100/1000000) * avg(d116) avg2, 0.0001 * min(d116) min2, max(d116)/10000 max2 from dtypes;
select avg(d117), min(d117), max(d117), (100/1000000) * avg(d117) avg2, 0.0001 * min(d117) min2, max(d117)/10000 max2 from dtypes;
select avg(d118), min(d118), max(d118), (100/1000000) * avg(d118) avg2, 0.0001 * min(d118) min2, max(d118)/10000 max2 from dtypes;
select avg(d119), min(d119), max(d119), (100/1000000) * avg(d119) avg2, 0.0001 * min(d119) min2, max(d119)/10000 max2 from dtypes;
select avg(d120), min(d120), max(d120), (100/1000000) * avg(d120) avg2, 0.0001 * min(d120) min2, max(d120)/10000 max2 from dtypes;
select avg(d121), min(d121), max(d121), (100/1000000) * avg(d121) avg2, 0.0001 * min(d121) min2, max(d121)/10000 max2 from dtypes;
select avg(d122), min(d122), max(d122), (100/1000000) * avg(d122) avg2, 0.0001 * min(d122) min2, max(d122)/10000 max2 from dtypes;
select avg(d123), min(d123), max(d123), (100/1000000) * avg(d123) avg2, 0.0001 * min(d123) min2, max(d123)/10000 max2 from dtypes;
select avg(d124), min(d124), max(d124), (100/1000000) * avg(d124) avg2, 0.0001 * min(d124) min2, max(d124)/10000 max2 from dtypes;
select avg(d125), min(d125), max(d125), (100/1000000) * avg(d125) avg2, 0.0001 * min(d125) min2, max(d125)/10000 max2 from dtypes;
select avg(d126), min(d126), max(d126), (100/1000000) * avg(d126) avg2, 0.0001 * min(d126) min2, max(d126)/10000 max2 from dtypes;
select avg(d127), min(d127), max(d127), (100/1000000) * avg(d127) avg2, 0.0001 * min(d127) min2, max(d127)/10000 max2 from dtypes;
select avg(d128), min(d128), max(d128), (100/1000000) * avg(d128) avg2, 0.0001 * min(d128) min2, max(d128)/10000 max2 from dtypes;
select avg(d129), min(d129), max(d129), (100/1000000) * avg(d129) avg2, 0.0001 * min(d129) min2, max(d129)/10000 max2 from dtypes;
select avg(d130), min(d130), max(d130), (100/1000000) * avg(d130) avg2, 0.0001 * min(d130) min2, max(d130)/10000 max2 from dtypes;
select avg(d131), min(d131), max(d131), (100/1000000) * avg(d131) avg2, 0.0001 * min(d131) min2, max(d131)/10000 max2 from dtypes;
select avg(d132), min(d132), max(d132), (100/1000000) * avg(d132) avg2, 0.0001 * min(d132) min2, max(d132)/10000 max2 from dtypes;
select avg(d133), min(d133), max(d133), (100/1000000) * avg(d133) avg2, 0.0001 * min(d133) min2, max(d133)/10000 max2 from dtypes;
select avg(d134), min(d134), max(d134), (100/1000000) * avg(d134) avg2, 0.0001 * min(d134) min2, max(d134)/10000 max2 from dtypes;
select avg(d135), min(d135), max(d135), (100/1000000) * avg(d135) avg2, 0.0001 * min(d135) min2, max(d135)/10000 max2 from dtypes;
select avg(d136), min(d136), max(d136), (100/1000000) * avg(d136) avg2, 0.0001 * min(d136) min2, max(d136)/10000 max2 from dtypes;
select avg(d137), min(d137), max(d137), (100/1000000) * avg(d137) avg2, 0.0001 * min(d137) min2, max(d137)/10000 max2 from dtypes;
select avg(d138), min(d138), max(d138), (100/1000000) * avg(d138) avg2, 0.0001 * min(d138) min2, max(d138)/10000 max2 from dtypes;
select avg(d139), min(d139), max(d139), (100/1000000) * avg(d139) avg2, 0.0001 * min(d139) min2, max(d139)/10000 max2 from dtypes;
select avg(d140), min(d140), max(d140), (100/1000000) * avg(d140) avg2, 0.0001 * min(d140) min2, max(d140)/10000 max2 from dtypes;
select avg(d141), min(d141), max(d141), (100/1000000) * avg(d141) avg2, 0.0001 * min(d141) min2, max(d141)/10000 max2 from dtypes;
select avg(d142), min(d142), max(d142), (100/1000000) * avg(d142) avg2, 0.0001 * min(d142) min2, max(d142)/10000 max2 from dtypes;
select avg(d143), min(d143), max(d143), (100/1000000) * avg(d143) avg2, 0.0001 * min(d143) min2, max(d143)/10000 max2 from dtypes;
select avg(d144), min(d144), max(d144), (100/1000000) * avg(d144) avg2, 0.0001 * min(d144) min2, max(d144)/10000 max2 from dtypes;
select avg(d145), min(d145), max(d145), (100/1000000) * avg(d145) avg2, 0.0001 * min(d145) min2, max(d145)/10000 max2 from dtypes;
select avg(d160), min(d160), max(d160), (100/1000000) * avg(d160) avg2, 0.0001 * min(d160) min2, max(d160)/10000 max2 from dtypes;
select avg(d161), min(d161), max(d161), (100/1000000) * avg(d161) avg2, 0.0001 * min(d161) min2, max(d161)/10000 max2 from dtypes;
select avg(d162), min(d162), max(d162), (100/1000000) * avg(d162) avg2, 0.0001 * min(d162) min2, max(d162)/10000 max2 from dtypes;
select avg(d171), min(d171), max(d171), (100/1000000) * avg(d171) avg2, 0.0001 * min(d171) min2, max(d171)/10000 max2 from dtypes;
select avg(d172), min(d172), max(d172), (100/1000000) * avg(d172) avg2, 0.0001 * min(d172) min2, max(d172)/10000 max2 from dtypes;
select avg(d173), min(d173), max(d173), (100/1000000) * avg(d173) avg2, 0.0001 * min(d173) min2, max(d173)/10000 max2 from dtypes;
select avg(d174), min(d174), max(d174), (100/1000000) * avg(d174) avg2, 0.0001 * min(d174) min2, max(d174)/10000 max2 from dtypes;
select avg(d175), min(d175), max(d175), (100/1000000) * avg(d175) avg2, 0.0001 * min(d175) min2, max(d175)/10000 max2 from dtypes;
select avg(d176), min(d176), max(d176), (100/1000000) * avg(d176) avg2, 0.0001 * min(d176) min2, max(d176)/10000 max2 from dtypes;
select avg(d177), min(d177), max(d177), (100/1000000) * avg(d177) avg2, 0.0001 * min(d177) min2, max(d177)/10000 max2 from dtypes;
select avg(d178), min(d178), max(d178), (100/1000000) * avg(d178) avg2, 0.0001 * min(d178) min2, max(d178)/10000 max2 from dtypes;
select avg(d179), min(d179), max(d179), (100/1000000) * avg(d179) avg2, 0.0001 * min(d179) min2, max(d179)/10000 max2 from dtypes;
select avg(d180), min(d180), max(d180), (100/1000000) * avg(d180) avg2, 0.0001 * min(d180) min2, max(d180)/10000 max2 from dtypes;
#

Some files were not shown because too many files have changed in this diff Show More