[add cases]
This commit is contained in:
parent
a35f5e16dd
commit
52e393a42d
|
@ -23,7 +23,7 @@
|
||||||
./test.sh -f tsim/insert/null.sim
|
./test.sh -f tsim/insert/null.sim
|
||||||
|
|
||||||
# ---- parser
|
# ---- parser
|
||||||
#./test.sh -f tsim/parser/groupby-basic.sim
|
./test.sh -f tsim/parser/groupby-basic.sim
|
||||||
#./test.sh -f tsim/parser/fourArithmetic-basic.sim
|
#./test.sh -f tsim/parser/fourArithmetic-basic.sim
|
||||||
|
|
||||||
# ---- query
|
# ---- query
|
||||||
|
|
|
@ -45,7 +45,7 @@ $tstart = 1640966400000 # 2022-01-01 00:00:00.000
|
||||||
print ==== create db, stable, ctables, insert data
|
print ==== create db, stable, ctables, insert data
|
||||||
sql drop database if exists $db -x step1
|
sql drop database if exists $db -x step1
|
||||||
step1:
|
step1:
|
||||||
sql create database if not exists $db keep 3650
|
sql create database if not exists $db
|
||||||
sql use $db
|
sql use $db
|
||||||
|
|
||||||
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(12))
|
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(12))
|
||||||
|
@ -131,6 +131,7 @@ if $data91 != 9 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
print ==== select first(ts),c1 from group_tb0 group by c1;
|
||||||
sql select first(ts),c1 from group_tb0 group by c1;
|
sql select first(ts),c1 from group_tb0 group by c1;
|
||||||
print rows: $rows
|
print rows: $rows
|
||||||
print $data00 $data01 $data02 $data03
|
print $data00 $data01 $data02 $data03
|
||||||
|
@ -155,55 +156,74 @@ if $data91 != 9 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============> filter not supported yet.
|
print ==== select first(ts),c1 from interval(5m) group_tb0 group by c1;
|
||||||
#sql select sum(c1), c1, avg(c1), min(c1), max(c2) from group_tb0 where c1 < 20 group by c1;
|
sql select first(ts),c1 from group_tb0 group by c1;
|
||||||
#if $row != 20 then
|
print rows: $rows
|
||||||
# return -1
|
print $data00 $data01 $data02 $data03
|
||||||
#endi
|
print $data10 $data11 $data12 $data13
|
||||||
#
|
print $data20 $data21 $data22 $data23
|
||||||
#if $data00 != 0 then
|
print $data80 $data81 $data82 $data83
|
||||||
# return -1
|
print $data90 $data91 $data92 $data93
|
||||||
#endi
|
|
||||||
#
|
return
|
||||||
#if $data01 != 0 then
|
|
||||||
# return -1
|
|
||||||
#endi
|
|
||||||
#
|
|
||||||
#print $data02
|
|
||||||
#if $data02 != 0.000000000 then
|
|
||||||
# return -1
|
|
||||||
#endi
|
|
||||||
#
|
|
||||||
#if $data03 != 0 then
|
|
||||||
# return -1
|
sql select sum(c1), c1, avg(c1), min(c1), max(c2) from group_tb0 where c1 < 20 group by c1;
|
||||||
#endi
|
if $row != 20 then
|
||||||
#
|
return -1
|
||||||
#print $data04
|
endi
|
||||||
#if $data04 != 0.00000 then
|
|
||||||
# return -1
|
if $data00 != 0 then
|
||||||
#endi
|
return -1
|
||||||
#
|
endi
|
||||||
#if $data10 != 100 then
|
|
||||||
# return -1
|
if $data01 != 0 then
|
||||||
#endi
|
return -1
|
||||||
#
|
endi
|
||||||
#if $data11 != 1 then
|
|
||||||
# return -1
|
print $data02
|
||||||
#endi
|
if $data02 != 0.000000000 then
|
||||||
#
|
return -1
|
||||||
#print $data12
|
endi
|
||||||
#if $data12 != 1.000000000 then
|
|
||||||
# return -1
|
if $data03 != 0 then
|
||||||
#endi
|
return -1
|
||||||
#
|
endi
|
||||||
#if $data13 != 1 then
|
|
||||||
# return -1
|
print $data04
|
||||||
#endi
|
if $data04 != 0.00000 then
|
||||||
#
|
return -1
|
||||||
#if $data14 != 1.00000 then
|
endi
|
||||||
# print expect 1.00000, actual:$data14
|
|
||||||
# return -1
|
if $data10 != 100 then
|
||||||
#endi
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data11 != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print $data12
|
||||||
|
if $data12 != 1.000000000 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data13 != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data14 != 1.00000 then
|
||||||
|
print expect 1.00000, actual:$data14
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
sql_error select sum(c1), ts, c1 from group_tb0 where c1<20 group by c1;
|
sql_error select sum(c1), ts, c1 from group_tb0 where c1<20 group by c1;
|
||||||
sql_error select first(ts), ts, c2 from group_tb0 where c1 < 20 group by c1;
|
sql_error select first(ts), ts, c2 from group_tb0 where c1 < 20 group by c1;
|
||||||
|
|
Loading…
Reference in New Issue