--INT8
\set VERBOSITY terse
CREATE TABLE vint8_test(a INT8, b INT8, c INT8) with (orientation = column) ;
copy vint8_test from '@abs_srcdir@/data/vint8_normal.data' delimiter '|' NULL '';
--test vint8pl
--select b+c, (b+c) is NULL from vint8_test where a <= 3 order by a;
select b+c as result from vint8_test where a <= 3::int8 order by a;
select b+c as result from vint8_test where a <= 10::int8 order by a; --out-of-range
--test vint8mul
--select b-c, (b-c) is NULL from vint8_test where a > 10 and a <= 14 order by a;
select b-c as result from vint8_test where a > 10::int8 and a <= 14::int8 order by a;
select b-c as result from vint8_test where a > 10::int8 and a <= 20::int8 order by a; --out-of-range
--test vint8mi
--select b*c, (b*c) is NULL from vint8_test where a > 20 and a <= 24 order by a;
select b*c as result from vint8_test where a > 20::int8 and a <= 24::int8 order by a;
select b*c as result from vint8_test where a > 20::int8 and a <= 30::int8 order by a; --out-of-range
--test vint8pl for int84pl/int48pl
select b+(-2) as result from vint8_test where a <= 3::int8 order by a;
select (-2)+b as result from vint8_test where a <= 10::int8 order by a;
--test vint8mul for int84mul/int48mul
select b*(-2) as result from vint8_test where a > 20::int8 and a <= 24::int8 order by a;
select (-2)*b as result from vint8_test where a > 20::int8 and a <= 30::int8 order by a; --out-of-range
--test vint8mi for int48mi/int84mi
select b-(-2) as result from vint8_test where a > 10::int8 and a <= 14::int8 order by a;
select (-2)-b as result from vint8_test where a > 10::int8 and a <= 20::int8 order by a; --out-of-range
select max(b),max(c) from vint8_test;
select min(b),min(c) from vint8_test;
select avg(b),avg(c) from vint8_test;
select sum(b),sum(c) from vint8_test;
--test vint8_sop
select b,c from vint8_test where b=c order by a;
select b,c from vint8_test where b<>c order by a;
select b,c from vint8_test where b>c order by a;
select b,c from vint8_test where b>=c order by a;
select b,c from vint8_test where b<c order by a;
select b,c from vint8_test where b<=c order by a;
--clean table
drop table vint8_test;