diff --git a/tests/script/tsim/stream/fillIntervalDelete0.sim b/tests/script/tsim/stream/fillIntervalDelete0.sim index 77d09d5ae891010dbc154d3aa7b807bc31f86d69..1c0647d57b29a044ce8ae3fb4052423768a0d66e 100644 --- a/tests/script/tsim/stream/fillIntervalDelete0.sim +++ b/tests/script/tsim/stream/fillIntervalDelete0.sim @@ -163,7 +163,7 @@ endi if $data01 != 4 then print =====data01=$data01 - return -1 + goto loop3 endi @@ -239,7 +239,7 @@ endi if $data01 != 6 then print =====data01=$data01 - return -1 + goto loop5 endi diff --git a/tests/script/tsim/stream/fillIntervalDelete1.sim b/tests/script/tsim/stream/fillIntervalDelete1.sim index ca347f120a8dacbc5d6e3d09099cc4e21fc8ed76..0206b88fdca9d97bd8e2bab6c1812c84f44b98f2 100644 --- a/tests/script/tsim/stream/fillIntervalDelete1.sim +++ b/tests/script/tsim/stream/fillIntervalDelete1.sim @@ -325,19 +325,19 @@ if $rows != 12 then endi if $data21 != 3 then print ====streamt10=data21=$data21 - return -1 + goto loop6 endi if $data31 != 4 then print ====streamt10=data31=$data31 - return -1 + goto loop6 endi if $data71 != 8 then print ====streamt10=data71=$data71 - return -1 + goto loop6 endi if $data91 != 10 then print ====streamt10=data91=$data91 - return -1 + goto loop6 endi diff --git a/tests/script/tsim/stream/fillIntervalLinear.sim b/tests/script/tsim/stream/fillIntervalLinear.sim index 4d0f101b6c10f4ca14499c7d59c68ea46a16b8d6..b9f301d81bed7f8fc71a9c4522290c833d46d6ee 100644 --- a/tests/script/tsim/stream/fillIntervalLinear.sim +++ b/tests/script/tsim/stream/fillIntervalLinear.sim @@ -9,6 +9,8 @@ system sh/exec.sh -n dnode1 -s start sleep 200 sql connect +print step 1 start + sql drop stream if exists streams1; sql drop database if exists test1; sql create database test1 vgroups 1; @@ -38,161 +40,165 @@ endi if $data01 != 2.000000000 then print =====data01=$data01 - return -1 + goto loop1 endi if $data02 != 1.000000000 then print =====data02=$data02 - return -1 + goto loop1 endi if $data03 != ccc then print =====data03=$data03 - return -1 + goto loop1 endi if $data04 != 1 then print =====data04=$data04 - return -1 + goto loop1 endi if $data11 != 4.000000000 then print =====data11=$data11 - return -1 + goto loop1 endi + if $data12 != 2.000000000 then print =====data12=$data12 - return -1 + goto loop1 endi + if $data13 != NULL then print =====data13=$data13 - return -1 + goto loop1 endi if $data21 != 6.000000000 then print =====data21=$data21 - return -1 + goto loop1 endi if $data22 != 3.000000000 then print =====data22=$data22 - return -1 + goto loop1 endi if $data23 != NULL then print =====data23=$data23 - return -1 + goto loop1 endi if $data31 != 8.000000000 then print =====data31=$data31 - return -1 + goto loop1 endi if $data32 != 4.000000000 then print =====data32=$data32 - return -1 + goto loop1 endi if $data33 != aaa then print =====data33=$data33 - return -1 + goto loop1 endi if $data41 != 8.666666667 then print =====data41=$data41 - return -1 + goto loop1 endi if $data42 != 4.333333333 then print =====data42=$data42 - return -1 + goto loop1 endi if $data43 != NULL then print =====data43=$data43 - return -1 + goto loop1 endi if $data51 != 9.333333333 then print =====data01=$data01 - return -1 + goto loop1 endi if $data52 != 4.666666667 then print =====data52=$data52 - return -1 + goto loop1 endi if $data53 != NULL then print =====data53=$data53 - return -1 + goto loop1 endi if $data61 != 10.000000000 then print =====data61=$data61 - return -1 + goto loop1 endi if $data62 != 5.000000000 then print =====data62=$data62 - return -1 + goto loop1 endi if $data71 != 8.000000000 then print =====data71=$data71 - return -1 + goto loop1 endi if $data72 != 4.000000000 then print =====data72=$data72 - return -1 + goto loop1 endi if $data81 != 6.000000000 then print =====data81=$data81 - return -1 + goto loop1 endi if $data82 != 3.000000000 then print =====data82=$data82 - return -1 + goto loop1 endi if $data91 != 4.000000000 then print =====data91=$data91 - return -1 + goto loop1 endi if $data92 != 2.000000000 then print =====data92=$data92 - return -1 + goto loop1 endi if $data[10][1] != 4.666666667 then print =====data[10][1]=$data[10][1] - return -1 + goto loop1 endi if $data[10][2] != 2.333333333 then print =====data[10][2]=$data[10][2] - return -1 + goto loop1 endi if $data[11][1] != 5.333333333 then print =====data[11][1]=$data[11][1] - return -1 + goto loop1 endi if $data[11][2] != 2.666666667 then print =====data[11][2]=$data[11][2] - return -1 + goto loop1 endi if $data[12][1] != 6.000000000 then print =====data[12][1]=$data[12][1] - return -1 + goto loop1 endi if $data[12][2] != 3.000000000 then print =====data[12][2]=$data[12][2] - return -1 + goto loop1 endi +print step 1 end +print step 2 start sql drop stream if exists streams2; sql drop database if exists test2; @@ -224,161 +230,163 @@ endi if $data01 != 2.000000000 then print =====data01=$data01 - return -1 + goto loop2 endi if $data02 != 1.000000000 then print =====data02=$data02 - return -1 + goto loop2 endi if $data03 != ccc then print =====data03=$data03 - return -1 + goto loop2 endi if $data04 != 1 then print =====data04=$data04 - return -1 + goto loop2 endi if $data11 != 4.000000000 then print =====data11=$data11 - return -1 + goto loop2 endi if $data12 != 2.000000000 then print =====data12=$data12 - return -1 + goto loop2 endi if $data13 != NULL then print =====data13=$data13 - return -1 + goto loop2 endi if $data21 != 6.000000000 then print =====data21=$data21 - return -1 + goto loop2 endi if $data22 != 3.000000000 then print =====data22=$data22 - return -1 + goto loop2 endi if $data23 != NULL then print =====data23=$data23 - return -1 + goto loop2 endi if $data31 != 8.000000000 then print =====data31=$data31 - return -1 + goto loop2 endi if $data32 != 4.000000000 then print =====data32=$data32 - return -1 + goto loop2 endi if $data33 != aaa then print =====data33=$data33 - return -1 + goto loop2 endi if $data41 != 8.666666667 then print =====data41=$data41 - return -1 + goto loop2 endi if $data42 != 4.333333333 then print =====data42=$data42 - return -1 + goto loop2 endi if $data43 != NULL then print =====data43=$data43 - return -1 + goto loop2 endi if $data51 != 9.333333333 then print =====data01=$data01 - return -1 + goto loop2 endi if $data52 != 4.666666667 then print =====data52=$data52 - return -1 + goto loop2 endi if $data53 != NULL then print =====data53=$data53 - return -1 + goto loop2 endi if $data61 != 10.000000000 then print =====data61=$data61 - return -1 + goto loop2 endi if $data62 != 5.000000000 then print =====data62=$data62 - return -1 + goto loop2 endi if $data71 != 8.000000000 then print =====data71=$data71 - return -1 + goto loop2 endi if $data72 != 4.000000000 then print =====data72=$data72 - return -1 + goto loop2 endi if $data81 != 6.000000000 then print =====data81=$data81 - return -1 + goto loop2 endi if $data82 != 3.000000000 then print =====data82=$data82 - return -1 + goto loop2 endi if $data91 != 4.000000000 then print =====data91=$data91 - return -1 + goto loop2 endi if $data92 != 2.000000000 then print =====data92=$data92 - return -1 + goto loop2 endi if $data[10][1] != 4.666666667 then print =====data[10][1]=$data[10][1] - return -1 + goto loop2 endi if $data[10][2] != 2.333333333 then print =====data[10][2]=$data[10][2] - return -1 + goto loop2 endi if $data[11][1] != 5.333333333 then print =====data[11][1]=$data[11][1] - return -1 + goto loop2 endi if $data[11][2] != 2.666666667 then print =====data[11][2]=$data[11][2] - return -1 + goto loop2 endi if $data[12][1] != 6.000000000 then print =====data[12][1]=$data[12][1] - return -1 + goto loop2 endi if $data[12][2] != 3.000000000 then print =====data[12][2]=$data[12][2] - return -1 + goto loop2 endi +print step 2 end +print step 3 start sql drop stream if exists streams3; sql drop database if exists test3; @@ -412,98 +420,98 @@ endi if $data01 != 3 then print =====data01=$data01 - return -1 + goto loop3 endi if $data02 != 6.000000000 then print =====data02=$data02 - return -1 + goto loop3 endi if $data03 != ccc then print =====data03=$data03 - return -1 + goto loop3 endi if $data11 != 3 then print =====data11=$data11 - return -1 + goto loop3 endi if $data12 != 7.000000000 then print =====data12=$data12 - return -1 + goto loop3 endi if $data13 != NULL then print =====data13=$data13 - return -1 + goto loop3 endi if $data21 != 4 then print =====data21=$data21 - return -1 + goto loop3 endi if $data22 != 8.000000000 then print =====data22=$data22 - return -1 + goto loop3 endi if $data23 != ddd then print =====data23=$data23 - return -1 + goto loop3 endi if $data31 != 2 then print =====data31=$data31 - return -1 + goto loop3 endi if $data32 != 5.000000000 then print =====data32=$data32 - return -1 + goto loop3 endi if $data33 != NULL then print =====data33=$data33 - return -1 + goto loop3 endi if $data41 != 1 then print =====data41=$data41 - return -1 + goto loop3 endi if $data42 != 2.000000000 then print =====data42=$data42 - return -1 + goto loop3 endi if $data43 != aaa then print =====data43=$data43 - return -1 + goto loop3 endi if $data51 != 1 then print =====data51=$data51 - return -1 + goto loop3 endi if $data52 != 3.000000000 then print =====data52=$data52 - return -1 + goto loop3 endi if $data53 != NULL then print =====data53=$data53 - return -1 + goto loop3 endi if $data61 != 2 then print =====data61=$data61 - return -1 + goto loop3 endi if $data62 != 4.000000000 then print =====data62=$data62 - return -1 + goto loop3 endi if $data63 != bbb then print =====data63=$data63 - return -1 + goto loop3 endi @@ -534,42 +542,42 @@ endi if $data01 != 6 then print =====data01=$data01 - return -1 + goto loop4 endi if $data02 != 12.000000000 then print =====data02=$data02 - return -1 + goto loop4 endi if $data03 != fff then print =====data03=$data03 - return -1 + goto loop4 endi if $data11 != 6 then print =====data11=$data11 - return -1 + goto loop4 endi if $data12 != 13.000000000 then print =====data12=$data12 - return -1 + goto loop4 endi if $data13 != NULL then print =====data13=$data13 - return -1 + goto loop4 endi if $data21 != 7 then print =====data21=$data21 - return -1 + goto loop4 endi if $data22 != 14.000000000 then print =====data22=$data22 - return -1 + goto loop4 endi if $data23 != ggg then print =====data23=$data23 - return -1 + goto loop4 endi @@ -626,33 +634,10 @@ if $data[12][3] != hhh then return -1 endi -if $data[13][1] != 8 then - print =====data[13][1]=$data[13][1] - return -1 -endi -if $data[13][2] != 17.000000000 then - print =====data[13][2]=$data[13][2] - return -1 -endi -if $data[13][3] != NULL then - print =====data[13][3]=$data[13][3] - return -1 -endi -if $data[14][1] != 9 then - print =====data[14][1]=$data[14][1] - return -1 -endi -if $data[14][2] != 18.000000000 then - print =====data[14][2]=$data[14][2] - return -1 -endi -if $data[14][3] != iii then - print =====data[14][3]=$data[14][3] - return -1 -endi +print step 3 end diff --git a/tests/script/tsim/stream/fillIntervalPartitionBy.sim b/tests/script/tsim/stream/fillIntervalPartitionBy.sim index 8c06ca8bbdfe5ffd99ea81513a56827f5f22376d..168452fdc8950223a944b1b18e23e0a3dd508873 100644 --- a/tests/script/tsim/stream/fillIntervalPartitionBy.sim +++ b/tests/script/tsim/stream/fillIntervalPartitionBy.sim @@ -149,7 +149,7 @@ endi if $data04 == 0 then print ====streamt1=data04=$data04 - return -1 + goto loop4 endi sql select group_id,count(*) from streamt1 group by group_id; @@ -168,7 +168,7 @@ endi if $data04 == 0 then print ====streamt2=data04=$data04 - return -1 + goto loop4 endi sql select group_id,count(*) from streamt2 group by group_id; @@ -187,7 +187,7 @@ endi if $data04 == 0 then print ====streamt3=data04=$data04 - return -1 + goto loop4 endi sql select group_id,count(*) from streamt3 group by group_id; @@ -207,7 +207,7 @@ endi if $data04 == 0 then print ====streamt4=data04=$data04 - return -1 + goto loop4 endi sql select group_id,count(*) from streamt4 group by group_id; @@ -226,7 +226,7 @@ endi if $data04 == 0 then print ====streamt5=data04=$data04 - return -1 + goto loop4 endi sql select group_id,count(*) from streamt5 group by group_id; diff --git a/tests/script/tsim/stream/fillIntervalPrevNext.sim b/tests/script/tsim/stream/fillIntervalPrevNext.sim index 4eadd7e7b1b976bcd7b78b5a4a3ec37de6a5549d..99f7dcb5cb03aa9734efae6bfe3429c98c7d9ad8 100644 --- a/tests/script/tsim/stream/fillIntervalPrevNext.sim +++ b/tests/script/tsim/stream/fillIntervalPrevNext.sim @@ -228,31 +228,31 @@ endi if $data72 != 6.000000000 then print =====data72=$data72 - return -1 + goto loop1 endi if $data73 != 3.000000000 then print =====data73=$data73 - return -1 + goto loop1 endi if $data82 != 6.000000000 then print =====data82=$data82 - return -1 + goto loop1 endi if $data83 != 3.000000000 then print =====data83=$data83 - return -1 + goto loop1 endi if $data92 != 6.000000000 then print =====data92=$data92 - return -1 + goto loop1 endi if $data93 != 3.000000000 then print =====data93=$data93 - return -1 + goto loop1 endi @@ -483,535 +483,33 @@ endi if $data72 != 6.000000000 then print =====data72=$data72 - return -1 + goto loop6 endi if $data73 != 3.000000000 then print =====data73=$data73 - return -1 + goto loop6 endi if $data82 != 6.000000000 then print =====data82=$data82 - return -1 + goto loop6 endi if $data83 != 3.000000000 then print =====data83=$data83 - return -1 + goto loop6 endi if $data92 != 6.000000000 then print =====data92=$data92 - return -1 + goto loop6 endi if $data93 != 3.000000000 then print =====data93=$data93 - return -1 -endi - - - -sql drop stream if exists streams7; -sql drop stream if exists streams8; -sql drop database if exists test7; -sql create database test7 vgroups 1; -sql use test7; -sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); -sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), b+c, s from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(prev); -sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), 1, b+1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(next); -sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa'); -sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb'); -sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc'); -sql insert into t1 values(1648791213000,4,4,4,4.0,'ddd'); - - -$loop_count = 0 - -loop7: -sleep 300 -sql select * from streamt7 order by ts; - -$loop_count = $loop_count + 1 -if $loop_count == 10 then - return -1 -endi - - -if $rows != 7 then - print =====rows=$rows - goto loop7 -endi - - -if $data01 != 3 then - print =====data01=$data01 - return -1 -endi -if $data02 != 6.000000000 then - print =====data02=$data02 - return -1 -endi -if $data03 != ccc then - print =====data03=$data03 - return -1 -endi - -if $data11 != 3 then - print =====data11=$data11 - return -1 -endi -if $data12 != 6.000000000 then - print =====data12=$data12 - return -1 -endi -if $data13 != ccc then - print =====data13=$data13 - return -1 -endi - - -if $data21 != 4 then - print =====data21=$data21 - return -1 -endi -if $data22 != 8.000000000 then - print =====data22=$data22 - return -1 -endi -if $data23 != ddd then - print =====data23=$data23 - return -1 -endi - - -if $data31 != 4 then - print =====data31=$data31 - return -1 -endi -if $data32 != 8.000000000 then - print =====data32=$data32 - return -1 -endi -if $data33 != ddd then - print =====data33=$data33 - return -1 -endi - - -if $data41 != 1 then - print =====data41=$data41 - return -1 -endi -if $data42 != 2.000000000 then - print =====data42=$data42 - return -1 -endi -if $data43 != aaa then - print =====data43=$data43 - return -1 -endi - - -if $data51 != 1 then - print =====data51=$data51 - return -1 -endi -if $data52 != 2.000000000 then - print =====data52=$data52 - return -1 -endi -if $data53 != aaa then - print =====data53=$data53 - return -1 -endi - - -if $data61 != 2 then - print =====data61=$data61 - return -1 -endi -if $data62 != 4.000000000 then - print =====data62=$data62 - return -1 -endi -if $data63 != bbb then - print =====data63=$data63 - return -1 -endi - -#-------------- - -sleep 200 -sql select * from streamt8 order by ts; - - -if $rows != 7 then - print =====rows=$rows - return -1 -endi - - -if $data01 != 3 then - print =====data01=$data01 - return -1 -endi -if $data02 != 1 then - print =====data02=$data02 - return -1 -endi -if $data03 != 4.000000000 then - print =====data03=$data03 - return -1 -endi - -if $data11 != 4 then - print =====data11=$data11 - return -1 -endi -if $data12 != 1 then - print =====data12=$data12 - return -1 -endi -if $data13 != 5.000000000 then - print =====data13=$data13 - return -1 -endi - - -if $data21 != 4 then - print =====data21=$data21 - return -1 -endi -if $data22 != 1 then - print =====data22=$data22 - return -1 -endi -if $data23 != 5.000000000 then - print =====data23=$data23 - return -1 -endi - - -if $data31 != 1 then - print =====data31=$data31 - return -1 -endi -if $data32 != 1 then - print =====data32=$data32 - return -1 -endi -if $data33 != 2.000000000 then - print =====data33=$data33 - return -1 -endi - - -if $data41 != 1 then - print =====data41=$data41 - return -1 -endi -if $data42 != 1 then - print =====data42=$data42 - return -1 -endi -if $data43 != 2.000000000 then - print =====data43=$data43 - return -1 -endi - - -if $data51 != 2 then - print =====data51=$data51 - return -1 -endi -if $data52 != 1 then - print =====data52=$data52 - return -1 -endi -if $data53 != 3.000000000 then - print =====data53=$data53 - return -1 -endi - - -if $data61 != 2 then - print =====data61=$data61 - return -1 -endi -if $data62 != 1 then - print =====data62=$data62 - return -1 -endi -if $data63 != 3.000000000 then - print =====data63=$data63 - return -1 -endi - -sql insert into t1 values(1648791212000,5,5,5,5.0,'eee'); -sql insert into t1 values(1648791207000,6,6,6,6.0,'fff') (1648791209000,7,7,7,7.0,'ggg') (1648791219000,8,8,8,8.0,'hhh') (1648791221000,9,9,9,9.0,'iii'); - - - -$loop_count = 0 - -loop8: -sleep 200 -sql select * from streamt7 order by ts; - -$loop_count = $loop_count + 1 -if $loop_count == 10 then - return -1 -endi - - -if $rows != 15 then - print =====rows=$rows - goto loop8 -endi - - -if $data01 != 6 then - print =====data01=$data01 - return -1 -endi -if $data02 != 12.000000000 then - print =====data02=$data02 - return -1 -endi -if $data03 != fff then - print =====data03=$data03 - return -1 -endi - -if $data11 != 6 then - print =====data11=$data11 - return -1 -endi -if $data12 != 12.000000000 then - print =====data12=$data12 - return -1 -endi -if $data13 != fff then - print =====data13=$data13 - return -1 -endi - - -if $data21 != 7 then - print =====data21=$data21 - return -1 -endi -if $data22 != 14.000000000 then - print =====data22=$data22 - return -1 -endi -if $data23 != ggg then - print =====data23=$data23 - return -1 -endi - - -if $data31 != 7 then - print =====data31=$data31 - return -1 -endi -if $data32 != 14.000000000 then - print =====data32=$data32 - return -1 -endi -if $data33 != ggg then - print =====data33=$data33 - return -1 -endi - -if $data51 != 5 then - print =====data51=$data51 - return -1 -endi -if $data52 != 10.000000000 then - print =====data52=$data52 - return -1 -endi -if $data53 != eee then - print =====data53=$data53 - return -1 -endi - - -if $data[11][1] != 2 then - print =====data[11][1]=$data[11][1] - return -1 -endi -if $data[11][2] != 4.000000000 then - print =====data[11][2]=$data[11][2] - return -1 -endi -if $data[11][3] != bbb then - print =====data[11][3]=$data[11][3] - return -1 -endi - -if $data[12][1] != 8 then - print =====data[12][1]=$data[12][1] - return -1 -endi -if $data[12][2] != 16.000000000 then - print =====data[12][2]=$data[12][2] - return -1 -endi -if $data[12][3] != hhh then - print =====data[12][3]=$data[12][3] - return -1 -endi - -if $data[13][1] != 8 then - print =====data[13][1]=$data[13][1] - return -1 -endi -if $data[13][2] != 16.000000000 then - print =====data[13][2]=$data[13][2] - return -1 -endi -if $data[13][3] != hhh then - print =====data[13][3]=$data[13][3] - return -1 -endi - -if $data[14][1] != 9 then - print =====data[14][1]=$data[14][1] - return -1 -endi -if $data[14][2] != 18.000000000 then - print =====data[14][2]=$data[14][2] - return -1 -endi -if $data[14][3] != iii then - print =====data[14][3]=$data[14][3] - return -1 -endi - -print fill next-----------------890 -sql use test7; -sql select * from streamt8 order by ts; - -if $rows != 15 then - print =====rows=$rows - goto loop8 -endi - - -if $data01 != 6 then - print =====data01=$data01 - return -1 -endi -if $data02 != 1 then - print =====data02=$data02 - return -1 -endi -if $data03 != 7.000000000 then - print =====data03=$data03 - return -1 -endi - -if $data11 != 7 then - print =====data11=$data11 - return -1 -endi -if $data13 != 8.000000000 then - print =====data13=$data13 - return -1 -endi - - -if $data21 != 7 then - print =====data21=$data21 - return -1 -endi -if $data23 != 8.000000000 then - print =====data23=$data23 - return -1 -endi - - -if $data31 != 3 then - print =====data31=$data31 - return -1 -endi -if $data33 != 4.000000000 then - print =====data33=$data33 - return -1 -endi - -if $data51 != 5 then - print =====data51=$data51 - return -1 -endi -if $data53 != 6.000000000 then - print =====data53=$data53 - return -1 -endi - - -if $data[11][1] != 8 then - print =====data[11][1]=$data[11][1] - return -1 -endi -if $data[11][2] != 1 then - print =====data[11][2]=$data[11][2] - return -1 -endi -if $data[11][3] != 9.000000000 then - print =====data[11][3]=$data[11][3] - return -1 -endi - -if $data[12][1] != 8 then - print =====data[12][1]=$data[12][1] - return -1 -endi -if $data[12][3] != 9.000000000 then - print =====data[12][3]=$data[12][3] - return -1 -endi - -if $data[13][1] != 9 then - print =====data[13][1]=$data[13][1] - return -1 -endi -if $data[13][3] != 10.000000000 then - print =====data[13][3]=$data[13][3] - return -1 -endi - -if $data[14][1] != 9 then - print =====data[14][1]=$data[14][1] - return -1 -endi -if $data[14][3] != 10.000000000 then - print =====data[14][3]=$data[14][3] - return -1 + goto loop6 endi - - - - - - - - - - - - - - - - - - - #==system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/fillIntervalPrevNext1.sim b/tests/script/tsim/stream/fillIntervalPrevNext1.sim new file mode 100644 index 0000000000000000000000000000000000000000..8058065bcf7d22938ea49221919e794e7a58e933 --- /dev/null +++ b/tests/script/tsim/stream/fillIntervalPrevNext1.sim @@ -0,0 +1,559 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +#==system sh/exec.sh -n dnode1 -s start -v + +sleep 200 +sql connect + + +sql drop stream if exists streams7; +sql drop stream if exists streams8; +sql drop database if exists test7; +sql create database test7 vgroups 1; +sql use test7; +sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20)); +sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), b+c, s from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(prev); +sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), 1, b+1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(next); +sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa'); +sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb'); +sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc'); +sql insert into t1 values(1648791213000,4,4,4,4.0,'ddd'); + + +$loop_count = 0 + +loop7: +sleep 300 +sql select * from streamt7 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +if $rows != 7 then + print =====rows=$rows + goto loop7 +endi + + +if $data01 != 3 then + print =====data01=$data01 + goto loop7 +endi +if $data02 != 6.000000000 then + print =====data02=$data02 + goto loop7 +endi +if $data03 != ccc then + print =====data03=$data03 + goto loop7 +endi + +if $data11 != 3 then + print =====data11=$data11 + goto loop7 +endi +if $data12 != 6.000000000 then + print =====data12=$data12 + goto loop7 +endi +if $data13 != ccc then + print =====data13=$data13 + goto loop7 +endi + + +if $data21 != 4 then + print =====data21=$data21 + goto loop7 +endi +if $data22 != 8.000000000 then + print =====data22=$data22 + goto loop7 +endi +if $data23 != ddd then + print =====data23=$data23 + goto loop7 +endi + + +if $data31 != 4 then + print =====data31=$data31 + goto loop7 +endi +if $data32 != 8.000000000 then + print =====data32=$data32 + goto loop7 +endi +if $data33 != ddd then + print =====data33=$data33 + goto loop7 +endi + + +if $data41 != 1 then + print =====data41=$data41 + goto loop7 +endi +if $data42 != 2.000000000 then + print =====data42=$data42 + goto loop7 +endi +if $data43 != aaa then + print =====data43=$data43 + goto loop7 +endi + + +if $data51 != 1 then + print =====data51=$data51 + goto loop7 +endi +if $data52 != 2.000000000 then + print =====data52=$data52 + goto loop7 +endi +if $data53 != aaa then + print =====data53=$data53 + goto loop7 +endi + + +if $data61 != 2 then + print =====data61=$data61 + goto loop7 +endi +if $data62 != 4.000000000 then + print =====data62=$data62 + goto loop7 +endi +if $data63 != bbb then + print =====data63=$data63 + goto loop7 +endi + +#-------------- + +loop71: + +$loop_count = 0 +sleep 300 + +sql select * from streamt8 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 7 then + print =====rows=$rows + goto loop71 +endi + + +if $data01 != 3 then + print =====data01=$data01 + goto loop71 +endi +if $data02 != 1 then + print =====data02=$data02 + goto loop71 +endi +if $data03 != 4.000000000 then + print =====data03=$data03 + goto loop71 +endi + +if $data11 != 4 then + print =====data11=$data11 + goto loop71 +endi +if $data12 != 1 then + print =====data12=$data12 + goto loop71 +endi +if $data13 != 5.000000000 then + print =====data13=$data13 + goto loop71 +endi + + +if $data21 != 4 then + print =====data21=$data21 + goto loop71 +endi +if $data22 != 1 then + print =====data22=$data22 + goto loop71 +endi +if $data23 != 5.000000000 then + print =====data23=$data23 + goto loop71 +endi + + +if $data31 != 1 then + print =====data31=$data31 + goto loop71 +endi +if $data32 != 1 then + print =====data32=$data32 + goto loop71 +endi +if $data33 != 2.000000000 then + print =====data33=$data33 + goto loop71 +endi + + +if $data41 != 1 then + print =====data41=$data41 + goto loop71 +endi +if $data42 != 1 then + print =====data42=$data42 + goto loop71 +endi +if $data43 != 2.000000000 then + print =====data43=$data43 + goto loop71 +endi + + +if $data51 != 2 then + print =====data51=$data51 + goto loop71 +endi +if $data52 != 1 then + print =====data52=$data52 + goto loop71 +endi +if $data53 != 3.000000000 then + print =====data53=$data53 + goto loop71 +endi + + +if $data61 != 2 then + print =====data61=$data61 + goto loop71 +endi +if $data62 != 1 then + print =====data62=$data62 + goto loop71 +endi +if $data63 != 3.000000000 then + print =====data63=$data63 + goto loop71 +endi + +sql insert into t1 values(1648791212000,5,5,5,5.0,'eee'); +sql insert into t1 values(1648791207000,6,6,6,6.0,'fff') (1648791209000,7,7,7,7.0,'ggg') (1648791219000,8,8,8,8.0,'hhh') (1648791221000,9,9,9,9.0,'iii'); + + + +$loop_count = 0 + +loop8: +sleep 200 +sql select * from streamt7 order by ts; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + + +if $rows != 15 then + print =====rows=$rows + goto loop8 +endi + + +if $data01 != 6 then + print =====data01=$data01 + goto loop8 +endi +if $data02 != 12.000000000 then + print =====data02=$data02 + goto loop8 +endi +if $data03 != fff then + print =====data03=$data03 + goto loop8 +endi + +if $data11 != 6 then + print =====data11=$data11 + goto loop8 +endi +if $data12 != 12.000000000 then + print =====data12=$data12 + goto loop8 +endi +if $data13 != fff then + print =====data13=$data13 + goto loop8 +endi + + +if $data21 != 7 then + print =====data21=$data21 + goto loop8 +endi +if $data22 != 14.000000000 then + print =====data22=$data22 + goto loop8 +endi +if $data23 != ggg then + print =====data23=$data23 + goto loop8 +endi + + +if $data31 != 7 then + print =====data31=$data31 + goto loop8 +endi +if $data32 != 14.000000000 then + print =====data32=$data32 + goto loop8 +endi +if $data33 != ggg then + print =====data33=$data33 + goto loop8 +endi + +if $data51 != 5 then + print =====data51=$data51 + goto loop8 +endi +if $data52 != 10.000000000 then + print =====data52=$data52 + goto loop8 +endi +if $data53 != eee then + print =====data53=$data53 + goto loop8 +endi + + +if $data[11][1] != 2 then + print =====data[11][1]=$data[11][1] + goto loop8 +endi +if $data[11][2] != 4.000000000 then + print =====data[11][2]=$data[11][2] + goto loop8 +endi +if $data[11][3] != bbb then + print =====data[11][3]=$data[11][3] + goto loop8 +endi + +if $data[12][1] != 8 then + print =====data[12][1]=$data[12][1] + goto loop8 +endi +if $data[12][2] != 16.000000000 then + print =====data[12][2]=$data[12][2] + goto loop8 +endi +if $data[12][3] != hhh then + print =====data[12][3]=$data[12][3] + goto loop8 +endi + +if $data[13][1] != 8 then + print =====data[13][1]=$data[13][1] + goto loop8 +endi +if $data[13][2] != 16.000000000 then + print =====data[13][2]=$data[13][2] + goto loop8 +endi +if $data[13][3] != hhh then + print =====data[13][3]=$data[13][3] + goto loop8 +endi + +if $data[14][1] != 9 then + print =====data[14][1]=$data[14][1] + goto loop8 +endi +if $data[14][2] != 18.000000000 then + print =====data[14][2]=$data[14][2] + goto loop8 +endi +if $data[14][3] != iii then + print =====data[14][3]=$data[14][3] + goto loop8 +endi + +print fill next-----------------890 +sql use test7; +sql select * from streamt8 order by ts; + +if $rows != 15 then + print =====rows=$rows + goto loop8 +endi + + +if $data01 != 6 then + print =====data01=$data01 + goto loop8 +endi +if $data02 != 1 then + print =====data02=$data02 + goto loop8 +endi +if $data03 != 7.000000000 then + print =====data03=$data03 + goto loop8 +endi + +if $data11 != 7 then + print =====data11=$data11 + goto loop8 +endi +if $data13 != 8.000000000 then + print =====data13=$data13 + goto loop8 +endi + + +if $data21 != 7 then + print =====data21=$data21 + goto loop8 +endi +if $data23 != 8.000000000 then + print =====data23=$data23 + goto loop8 +endi + + +if $data31 != 3 then + print =====data31=$data31 + goto loop8 +endi +if $data33 != 4.000000000 then + print =====data33=$data33 + goto loop8 +endi + +if $data51 != 5 then + print =====data51=$data51 + goto loop8 +endi +if $data53 != 6.000000000 then + print =====data53=$data53 + goto loop8 +endi + + +if $data[11][1] != 8 then + print =====data[11][1]=$data[11][1] + goto loop8 +endi +if $data[11][2] != 1 then + print =====data[11][2]=$data[11][2] + goto loop8 +endi +if $data[11][3] != 9.000000000 then + print =====data[11][3]=$data[11][3] + goto loop8 +endi + +if $data[12][1] != 8 then + print =====data[12][1]=$data[12][1] + goto loop8 +endi +if $data[12][3] != 9.000000000 then + print =====data[12][3]=$data[12][3] + goto loop8 +endi + +if $data[13][1] != 9 then + print =====data[13][1]=$data[13][1] + goto loop8 +endi +if $data[13][3] != 10.000000000 then + print =====data[13][3]=$data[13][3] + goto loop8 +endi + +if $data[14][1] != 9 then + print =====data[14][1]=$data[14][1] + goto loop8 +endi +if $data[14][3] != 10.000000000 then + print =====data[14][3]=$data[14][3] + goto loop8 +endi + + + + + + + + + + + + + + + + + + + + + + +#==system sh/exec.sh -n dnode1 -s stop -x SIGINT +#==print =============== check +#==$null= + +#==system_content sh/checkValgrind.sh -n dnode1 +#==print cmd return result ----> [ $system_content ] +#==if $system_content > 0 then +#== return -1 +#==endi + +#==if $system_content == $null then +#== return -1 +#==endi +#==return 1 + + + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop stream if exists streams5; +sql drop stream if exists streams6; +sql drop stream if exists streams7; +sql drop stream if exists streams8; + +sql use test7; +sql select * from t1; +print $data00 + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file