From 6134c9039860afc5e1041cc848c3741f0f70baaf Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 22 Sep 2023 13:47:50 +0800 Subject: [PATCH] fix: add more test case --- tests/script/tsim/query/bi_star_table.sim | 83 ++++++++++++++++++++++- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/tests/script/tsim/query/bi_star_table.sim b/tests/script/tsim/query/bi_star_table.sim index 5112ae3839..618408ff7d 100644 --- a/tests/script/tsim/query/bi_star_table.sim +++ b/tests/script/tsim/query/bi_star_table.sim @@ -23,7 +23,84 @@ sql create table tba1 using sta tags(1, 1, 1); sql create table tba2 using sta tags(2, 2, 2); set_bi_mode 1 -sql select * from db1.sta; -print $rows -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +sql select * from db1.sta order by ts; +if $cols != 7 then + return -1 +endi + +if $data06 != tba1 then + return -1 +endi + +sql select last(*) from db1.sta; +if $cols != 4 then + return -1 +endi + +if $data03 != tba2 then + return -1 +endi + +sql select last_row(*) from db1.sta; +if $cols != 4 then + return -1 +endi + +if $data03 != tba2 then + return -1 +endi + +sql select first(*) from db1.sta; +if $cols != 4 then + return -1 +endi + +if $data03 != tba1 then + return -1 +endi + +print "=====table star =====================" + +sql select b.* from db1.sta b order by ts; +if $cols != 7 then + return -1 +endi + +if $data06 != tba1 then + return -1 +endi + +sql select last(b.*) from db1.sta b; +if $cols != 4 then + return -1 +endi + +if $data03 != tba2 then + return -1 +endi + +sql select last_row(b.*) from db1.sta b; +if $cols != 4 then + return -1 +endi + +if $data03 != tba2 then + return -1 +endi + +sql select first(b.*) from db1.sta b; +if $cols != 4 then + return -1 +endi + +if $data03 != tba1 then + return -1 +endi + +set_bi_mode 0 +sql select * from db1.sta order by ts; +if $cols != 6 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT