From 1fc16355def4c0557addd32176d581c13817c38b Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 21 Nov 2023 14:34:09 +0800 Subject: [PATCH] enhance: bi mode tbname col to tbname func --- tests/script/tsim/query/bi_tbname_col.sim | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/script/tsim/query/bi_tbname_col.sim diff --git a/tests/script/tsim/query/bi_tbname_col.sim b/tests/script/tsim/query/bi_tbname_col.sim new file mode 100644 index 0000000000..7cf897280b --- /dev/null +++ b/tests/script/tsim/query/bi_tbname_col.sim @@ -0,0 +1,34 @@ + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +sql drop database if exists db1; +sql create database db1 vgroups 3; +sql create database db1; +sql use db1; +sql create stable sta (ts timestamp, f1 int, f2 binary(200)) tags(t1 int, t2 int, t3 int); +sql create stable stb (ts timestamp, f1 int, f2 binary(200)) tags(t1 int, t2 int, t3 int); +sql create table tba1 using sta tags(1, 1, 1); +sql create table tba2 using sta tags(2, 2, 2); +sql insert into tba1 values(now, 1, "1")(now+3s, 3, "3")(now+5s, 5, "5"); +sql insert into tba2 values(now + 1s, 2, "2")(now+2s, 2, "2")(now+4s, 4, "4"); +sql create table tbn1 (ts timestamp, f1 int); + +set_bi_mode 1 + +sql select `tbname`, f1, f2 from sta order by ts +print $rows +print $data00 $data01 $data02 $data10 $data11 $data12 +if $rows != 6 then + return -1 +endi +if $data00 != @tba1@ then + return -1 +endi +if $data10 != @tba2@ then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT