diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 9bc3d3d137..85c5a4e5d1 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -88,13 +88,13 @@ ./test.sh -f tsim/parser/alter_column.sim ./test.sh -f tsim/parser/alter_stable.sim ./test.sh -f tsim/parser/alter.sim -# ./test.sh -f tsim/parser/alter1.sim +# TD-17661 ./test.sh -f tsim/parser/alter1.sim ./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim ./test.sh -f tsim/parser/auto_create_tb.sim ./test.sh -f tsim/parser/between_and.sim ./test.sh -f tsim/parser/binary_escapeCharacter.sim -# ./test.sh -f tsim/parser/col_arithmetic_operation.sim -# ./test.sh -f tsim/parser/columnValue.sim +# TD-17738 ./test.sh -f tsim/parser/col_arithmetic_operation.sim +# TD-17661 ./test.sh -f tsim/parser/columnValue.sim ./test.sh -f tsim/parser/commit.sim # TD-17661 ./test.sh -f tsim/parser/condition.sim ./test.sh -f tsim/parser/constCol.sim @@ -111,9 +111,9 @@ ./test.sh -f tsim/parser/fourArithmetic-basic.sim # TD-17659 ./test.sh -f tsim/parser/function.sim ./test.sh -f tsim/parser/groupby-basic.sim -# ./test.sh -f tsim/parser/groupby.sim +./test.sh -f tsim/parser/groupby.sim # TD-17622 ./test.sh -f tsim/parser/having_child.sim -# ./test.sh -f tsim/parser/having.sim +# TD-17622 ./test.sh -f tsim/parser/having.sim ./test.sh -f tsim/parser/import_commit1.sim ./test.sh -f tsim/parser/import_commit2.sim ./test.sh -f tsim/parser/import_commit3.sim @@ -121,49 +121,46 @@ ./test.sh -f tsim/parser/import.sim ./test.sh -f tsim/parser/insert_multiTbl.sim ./test.sh -f tsim/parser/insert_tb.sim -# ./test.sh -f tsim/parser/interp.sim +# TD-17038 ./test.sh -f tsim/parser/interp.sim ./test.sh -f tsim/parser/join_manyblocks.sim -# ./test.sh -f tsim/parser/join_multitables.sim +# TD-17713 ./test.sh -f tsim/parser/join_multitables.sim # TD-17713 ./test.sh -f tsim/parser/join_multivnode.sim # TD-17707 ./test.sh -f tsim/parser/join.sim ./test.sh -f tsim/parser/last_cache.sim ./test.sh -f tsim/parser/last_groupby.sim -# TD-17675 ./test.sh -f tsim/parser/lastrow.sim +# TD-17722 ./test.sh -f tsim/parser/lastrow.sim ./test.sh -f tsim/parser/like.sim -# ./test.sh -f tsim/parser/limit.sim -# ./test.sh -f tsim/parser/limit1.sim -# ./test.sh -f tsim/parser/limit2.sim +# TD-17464 ./test.sh -f tsim/parser/limit.sim +# TD-17464 ./test.sh -f tsim/parser/limit1.sim +# TD-17623 ./test.sh -f tsim/parser/limit2.sim ./test.sh -f tsim/parser/mixed_blocks.sim ./test.sh -f tsim/parser/nchar.sim # TD-17703 ./test.sh -f tsim/parser/nestquery.sim -# ./test.sh -f tsim/parser/null_char.sim +# TD-17685 ./test.sh -f tsim/parser/null_char.sim ./test.sh -f tsim/parser/precision_ns.sim ./test.sh -f tsim/parser/projection_limit_offset.sim ./test.sh -f tsim/parser/regex.sim ./test.sh -f tsim/parser/select_across_vnodes.sim ./test.sh -f tsim/parser/select_distinct_tag.sim ./test.sh -f tsim/parser/select_from_cache_disk.sim -# ./test.sh -f tsim/parser/select_with_tags.sim +# TD-17659 ./test.sh -f tsim/parser/select_with_tags.sim ./test.sh -f tsim/parser/selectResNum.sim # TD-17685 ./test.sh -f tsim/parser/set_tag_vals.sim ./test.sh -f tsim/parser/single_row_in_tb.sim # TD-17684 ./test.sh -f tsim/parser/sliding.sim -# ./test.sh -f tsim/parser/slimit_alter_tags.sim -# ./test.sh -f tsim/parser/slimit.sim -# ./test.sh -f tsim/parser/slimit1.sim +# TD-17722 ./test.sh -f tsim/parser/slimit_alter_tags.sim +# TD-17722 ./test.sh -f tsim/parser/slimit.sim +# TD-17722 ./test.sh -f tsim/parser/slimit1.sim ./test.sh -f tsim/parser/stableOp.sim -# ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim -# ./test.sh -f tsim/parser/tags_filter.sim +# TD-17661 ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim +# TD-17661 ./test.sh -f tsim/parser/tags_filter.sim ./test.sh -f tsim/parser/tbnameIn.sim ./test.sh -f tsim/parser/timestamp.sim ./test.sh -f tsim/parser/top_groupby.sim ./test.sh -f tsim/parser/topbot.sim -# ./test.sh -f tsim/parser/udf_dll_stable.sim -# ./test.sh -f tsim/parser/udf_dll.sim -# ./test.sh -f tsim/parser/udf.sim ./test.sh -f tsim/parser/union.sim # TD-17704 ./test.sh -f tsim/parser/union_sysinfo.sim -# ./test.sh -f tsim/parser/where.sim +# TD-17661 ./test.sh -f tsim/parser/where.sim # ---- query ./test.sh -f tsim/query/interval.sim @@ -324,7 +321,7 @@ ./test.sh -f tsim/vnode/stable_replica3_vnode3.sim # --- sync -# ./test.sh -f tsim/sync/3Replica1VgElect.sim +./test.sh -f tsim/sync/3Replica1VgElect.sim ./test.sh -f tsim/sync/3Replica5VgElect.sim ./test.sh -f tsim/sync/oneReplica1VgElect.sim ./test.sh -f tsim/sync/oneReplica5VgElect.sim @@ -422,18 +419,18 @@ ./test.sh -f tsim/tag/bool_binary.sim ./test.sh -f tsim/tag/bool_int.sim ./test.sh -f tsim/tag/bool.sim -# ./test.sh -f tsim/tag/change.sim -# ./test.sh -f tsim/tag/column.sim -# ./test.sh -f tsim/tag/commit.sim -# ./test.sh -f tsim/tag/create.sim -# /test.sh -f tsim/tag/delete.sim -# ./test.sh -f tsim/tag/double.sim -# ./test.sh -f tsim/tag/filter.sim +# TD-17661 ./test.sh -f tsim/tag/change.sim +./test.sh -f tsim/tag/column.sim +./test.sh -f tsim/tag/commit.sim +# TD-17661 ./test.sh -f tsim/tag/create.sim +# TD-17661 ./test.sh -f tsim/tag/delete.sim +# TD-17661 ./test.sh -f tsim/tag/double.sim +# TD-17661 ./test.sh -f tsim/tag/filter.sim # TD-17407 ./test.sh -f tsim/tag/float.sim ./test.sh -f tsim/tag/int_binary.sim ./test.sh -f tsim/tag/int_float.sim ./test.sh -f tsim/tag/int.sim -# ./test.sh -f tsim/tag/set.sim +# TD-17661 ./test.sh -f tsim/tag/set.sim ./test.sh -f tsim/tag/smallint.sim ./test.sh -f tsim/tag/tinyint.sim diff --git a/tests/script/tsim/parser/col_arithmetic_query.sim b/tests/script/tsim/parser/col_arithmetic_query.sim index 8ee891660b..10840b2296 100644 --- a/tests/script/tsim/parser/col_arithmetic_query.sim +++ b/tests/script/tsim/parser/col_arithmetic_query.sim @@ -36,28 +36,22 @@ sql select c1 *( 2 / 3 ), c1/c1 from $tb order by ts asc; if $rows != 10000 then return -1 endi - if $data00 != 0.000000000 then return -1 endi - #if $data01 != -nan then # print expect -nan, actual: $data01 # return -1 #endi - if $data10 != 0.666666667 then return -1 endi - if $data11 != 1.000000000 then return -1 endi - if $data90 != 6.000000000 then return -1 endi - if $data91 != 1.000000000 then return -1 endi @@ -66,65 +60,49 @@ sql select (c1 * 2) % 7.9, c1*1, c1*1*1, c1*c1, c1*c1*c1 from $tb order by ts de if $rows != 10000 then return -1 endi - if $data00 != 2.200000000 then print expect 2.200000000, actual:$data00 return -1 endi - if $data01 != 9.000000000 then return -1 endi - if $data02 != 9.000000000 then return -1 endi - if $data03 != 81.000000000 then return -1 endi - if $data04 != 729.000000000 then return -1 endi - - if $data10 != 0.200000000 then return -1 endi - if $data11 != 8.000000000 then return -1 endi - if $data12 != 8.000000000 then return -1 endi - if $data13 != 64.000000000 then return -1 endi - if $data14 != 512.000000000 then return -1 endi - if $data90 != 0.000000000 then return -1 endi - if $data91 != 0.000000000 then return -1 endi - if $data92 != 0.000000000 then return -1 endi - if $data93 != 0.000000000 then return -1 endi - if $data94 != 0.000000000 then return -1 endi @@ -134,20 +112,16 @@ sql select c1 * c2 /4 from $tb where ts < 1537166000000 and ts > 1537156000000 if $rows != 17 then return -1 endi - if $data00 != 12.250000000 then return -1 endi - if $data10 != 16.000000000 then return -1 endi - if $data20 != 20.250000000 then print expect 20.250000000, actual:$data21 return -1 endi - if $data30 != 0.000000000 then return -1 endi @@ -180,47 +154,36 @@ sql select c2-c1*1.1, c3/c2, c4*c3, c5%c4, (c6+c4)%22, c2-c2 from $tb if $rows != 10000 then return -1 endi - if $data00 != 0.000000000 then return -1 endi - #if $data01 != -nan then # return -1 #endi - if $data02 != 0.000000000 then return -1 endi - if $data03 != NULL then return -1 endi - if $data04 != 0.000000000 then return -1 endi - if $data05 != 0.000000000 then return -1 endi - if $data90 != -0.900000000 then return -1 endi - if $data91 != 1.000000000 then return -1 endi - if $data92 != 81.000000000 then return -1 endi - if $data93 != 0.000000000 then return -1 endi - if $data94 != 18.000000000 then return -1 endi @@ -237,10 +200,8 @@ sql select c8+c7, c9+c9+c8+c7/c6 from $tb # arithmetic expression in join [d.7]================================================== - # arithmetic expression in union [d.8]================================================= - # arithmetic expression in group by [d.9]============================================== # in group by tag, not support for normal table sql_error select c5*99 from $tb group by t1 @@ -248,17 +209,14 @@ sql_error select c5*99 from $tb group by t1 # in group by column sql_error select c6-(c6+c3)*12 from $tb group by c3; - # limit offset [d.10]================================================================== sql select c6 * c1 + 12 from $tb limit 12 offset 99; if $rows != 12 then return -1 endi - if $data00 != 93.000000000 then return -1 endi - if $data90 != 76.000000000 then return -1 endi @@ -267,7 +225,6 @@ sql select c4 / 99.123 from $tb limit 10 offset 9999; if $rows != 1 then return -1 endi - if $data00 != 0.090796283 then return -1 endi @@ -283,27 +240,21 @@ sql select c1, c2+c6, 12.9876545678, 1, 1.1 from $tb if $rows != 10000 then return -1 endi - if $data00 != 0 then return -1 endi - if $data01 != 0.000000000 then return -1 endi - if $data02 != 12.987654568 then return -1 endi - if $data03 != 1 then return -1 endi - if $data04 != 1.100000000 then return -1 endi - if $data10 != 1 then return -1 endi @@ -313,27 +264,21 @@ sql select c1, c2+c6, 12.9876545678, 1, 1.1 from $tb where c1<2 if $rows != 2000 then return -1 endi - if $data00 != 0 then return -1 endi - if $data01 != 0.000000000 then return -1 endi - if $data02 != 12.987654568 then return -1 endi - if $data03 != 1 then return -1 endi - if $data10 != 1 then return -1 endi - if $data20 != 0 then return -1 endi @@ -377,7 +322,6 @@ sql select first(c1) * ( 2 / 3 ) from $stb order by ts asc; if $rows != 1 then return -1 endi - if $data00 != 0.000000000 then return -1 endi @@ -386,7 +330,6 @@ sql select first(c1) * (2/99) from $stb order by ts desc; if $rows != 1 then return -1 endi - if $data00 != 0.000000000 then return -1 endi @@ -395,15 +338,12 @@ sql select (count(c1) * 2) % 7.9, (count(c1) * 2), ( count(1)*2) from $stb if $rows != 1 then return -1 endi - if $data00 != 1.800000000 then return -1 endi - if $data01 != 100000.000000000 then return -1 endi - if $data02 != 200000.000000000 then return -1 endi @@ -412,16 +352,13 @@ sql select spread( c1 )/44, spread(c1), 0.204545455 * 44 from $stb if $rows != 1 then return -1 endi - if $data00 != 0.204545455 then print expect 0.204545455, actual: $data00 return -1 endi - if $data01 != 9.000000000 then return -1 endi - if $data02 != 9.000000020 then return -1 endi @@ -431,27 +368,21 @@ sql select min(c1) * max(c2) /4, sum(c1) * apercentile(c2, 20), apercentile(c4, if $rows != 1 then return -1 endi - if $data00 != 0.000000000 then return -1 endi - if $data01 != 225000.000000000 then return -1 endi - if $data02 != 8.077777778 then return -1 endi - if $data03 != NULL then return -1 endi - if $data04 != 0.444444444 then return -1 endi - if $data05 != 450000.000000000 then return -1 endi @@ -487,35 +418,29 @@ sql_error select top(c1, 99) - bottom(c1, 99) from $stb sql select c2-c1, c3/c2, c4*c3, c5%c4, c6+99%22 from $stb # error case, ts/bool/binary/nchar not support arithmetic expression -sql select first(c7)*12 from $stb -sql select last(c8)/55 from $stb -sql_error select last_row(c9) + last_row(c8) from $stb +sql select first(c7)*12 from $stb +sql select last(c8)/55 from $stb +sql select last_row(c9) + last_row(c8) from $stb # arithmetic expression in join [d.7]=============================================================== - # arithmetic expression in union [d.8]=============================================================== - # arithmetic expression in group by [d.9]=============================================================== # in group by tag -sql select avg(c4)*99 from $stb group by t1 +sql select avg(c4)*99, t1 from $stb group by t1 order by t1 if $rows != 10 then return -1 endi - if $data00 != 445.500000000 then return -1 endi - if $data01 != 0 then return -1 endi - if $data90 != 445.500000000 then return -1 endi - if $data91 != 9 then return -1 endi @@ -550,22 +475,19 @@ endi # return -1 #endi # -sql_error select first(c6) - last(c6) *12 / count(*) from $stb group by c3; +sql select first(c6) - last(c6) *12 / count(*) from $stb group by c3; -sql select first(c6) - last(c6) *12 / count(*) from $stb group by c5; -if $rows != 10 then +sql select first(c6) - last(c6) *12 / count(*) from $stb group by c5 order by c5; +if $rows != 11 then return -1 endi - -if $data00 != 0.000000000 then +if $data10 != 0.000000000 then return -1 endi - -if $data10 != 0.997600000 then +if $data20 != 0.997600000 then return -1 endi - -if $data90 != 8.978400000 then +if $data90 != 7.980800000 then return -1 endi @@ -574,7 +496,6 @@ sql select first(c6) - sum(c6) + 12 from $stb limit 12 offset 0; if $rows != 1 then return -1 endi - if $data00 != -449988.000000000 then return -1 endi @@ -604,10 +525,8 @@ sql_error select first(c1) from $stb fill(value, 20); # constant column. [d.13]=============================================================== - # column value filter [d.14]=============================================================== - # tag filter. [d.15]=============================================================== sql select sum(c2)+99 from $stb where t1=12; @@ -633,7 +552,6 @@ sql select avg(c2)*count(c2), sum(c3)-first(c3), last(c4)+9 from $stb interval(1 if $rows != 10000 then return -1 endi - if $data00 != @18-09-17 09:00:00.000@ then return -1 endi @@ -645,11 +563,9 @@ sql_error select first(c7)- last(c1) from $tb interval(2y) # first/last query [d.19]=============================================================== - # multiple retrieve [d.20]=============================================================== sql select c2-c2 from $tb - sql select first(c1)-last(c1), spread(c2), max(c3) - min(c3), avg(c4)*count(c4) from $tb diff --git a/tests/script/tsim/parser/columnValue_bigint.sim b/tests/script/tsim/parser/columnValue_bigint.sim index 0d89d9e61c..8841418ed3 100644 --- a/tests/script/tsim/parser/columnValue_bigint.sim +++ b/tests/script/tsim/parser/columnValue_bigint.sim @@ -1,4 +1,3 @@ -sleep 100 sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/columnValue_bool.sim b/tests/script/tsim/parser/columnValue_bool.sim index 3a7dcab265..3e8c408e13 100644 --- a/tests/script/tsim/parser/columnValue_bool.sim +++ b/tests/script/tsim/parser/columnValue_bool.sim @@ -1,4 +1,3 @@ -sleep 100 sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/columnValue_double.sim b/tests/script/tsim/parser/columnValue_double.sim index e5ba89158b..c7ba7b0048 100644 --- a/tests/script/tsim/parser/columnValue_double.sim +++ b/tests/script/tsim/parser/columnValue_double.sim @@ -1,5 +1,3 @@ -#### -sleep 100 sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/columnValue_float.sim b/tests/script/tsim/parser/columnValue_float.sim index 1832f7f847..8fca0d4671 100644 --- a/tests/script/tsim/parser/columnValue_float.sim +++ b/tests/script/tsim/parser/columnValue_float.sim @@ -1,5 +1,3 @@ -#### -sleep 100 sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/columnValue_int.sim b/tests/script/tsim/parser/columnValue_int.sim index 5536293ed2..66be28ef89 100644 --- a/tests/script/tsim/parser/columnValue_int.sim +++ b/tests/script/tsim/parser/columnValue_int.sim @@ -1,4 +1,3 @@ -sleep 100 sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/columnValue_smallint.sim b/tests/script/tsim/parser/columnValue_smallint.sim index 98b83fd0e1..6608b6cea4 100644 --- a/tests/script/tsim/parser/columnValue_smallint.sim +++ b/tests/script/tsim/parser/columnValue_smallint.sim @@ -1,5 +1,3 @@ -sleep 100 -sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/columnValue_tinyint.sim b/tests/script/tsim/parser/columnValue_tinyint.sim index 7b0cad23df..67c0f998ca 100644 --- a/tests/script/tsim/parser/columnValue_tinyint.sim +++ b/tests/script/tsim/parser/columnValue_tinyint.sim @@ -1,5 +1,3 @@ -sleep 100 -sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/columnValue_unsign.sim b/tests/script/tsim/parser/columnValue_unsign.sim index 8e44ccb5fa..4b8baf10cd 100644 --- a/tests/script/tsim/parser/columnValue_unsign.sim +++ b/tests/script/tsim/parser/columnValue_unsign.sim @@ -1,5 +1,3 @@ -sleep 100 -sql connect sql create database if not exists db sql use db diff --git a/tests/script/tsim/parser/first_last_query.sim b/tests/script/tsim/parser/first_last_query.sim index a001b929c3..adad554fb2 100644 --- a/tests/script/tsim/parser/first_last_query.sim +++ b/tests/script/tsim/parser/first_last_query.sim @@ -1,4 +1,3 @@ -sleep 100 sql connect $dbPrefix = first_db diff --git a/tests/script/tsim/parser/groupby-basic.sim b/tests/script/tsim/parser/groupby-basic.sim index 1edc99624a..7fe91f5100 100644 --- a/tests/script/tsim/parser/groupby-basic.sim +++ b/tests/script/tsim/parser/groupby-basic.sim @@ -3,25 +3,6 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start sql connect -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - -sql connect - $dbPrefix = group_db $tbPrefix = group_tb $mtPrefix = group_mt @@ -80,8 +61,6 @@ while $i < $tbNum $tstart = 1640966400000 endw -sleep 100 - $i1 = 1 $i2 = 0 @@ -752,12 +731,7 @@ sql insert into tm1 values('2020-2-1 1:1:1', 2, 10); sql insert into tm1 values('2020-2-1 1:1:2', 2, 20); system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 100 system sh/exec.sh -n dnode1 -s start -sleep 100 - -sql connect -sleep 100 sql use group_db0; print =========================>TD-4894 diff --git a/tests/script/tsim/parser/interp_test.sim b/tests/script/tsim/parser/interp_test.sim index 0bdf97a957..5c94b72b43 100644 --- a/tests/script/tsim/parser/interp_test.sim +++ b/tests/script/tsim/parser/interp_test.sim @@ -1,4 +1,3 @@ -sleep 100 sql connect $dbPrefix = intp_db diff --git a/tests/script/tsim/parser/join.sim b/tests/script/tsim/parser/join.sim index c052e24856..269d4ca254 100644 --- a/tests/script/tsim/parser/join.sim +++ b/tests/script/tsim/parser/join.sim @@ -54,8 +54,6 @@ while $i < $tbNum $tstart = 100000 endw -sleep 100 - $tstart = 100000 $mt = $mtPrefix . 1 . $i 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), t3 int) @@ -99,8 +97,6 @@ while $i < $tbNum $tstart = 100000 endw -sleep 100 - $i1 = 1 $i2 = 0 diff --git a/tests/script/tsim/parser/limit.sim b/tests/script/tsim/parser/limit.sim index f4a23697cd..bbee7a931d 100644 --- a/tests/script/tsim/parser/limit.sim +++ b/tests/script/tsim/parser/limit.sim @@ -62,11 +62,8 @@ run tsim/parser/limit_stb.sim print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 500 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql connect -sleep 100 run tsim/parser/limit_tb.sim run tsim/parser/limit_stb.sim diff --git a/tests/script/tsim/parser/limit1.sim b/tests/script/tsim/parser/limit1.sim index b6d0629c8f..6fbae4acd7 100644 --- a/tests/script/tsim/parser/limit1.sim +++ b/tests/script/tsim/parser/limit1.sim @@ -18,7 +18,7 @@ $stb = $stbPrefix . $i sql drop database $db -x step1 step1: -sql create database $db cache 16 +sql create database $db print ====== create tables sql use $db sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int) diff --git a/tests/script/tsim/parser/limit1_tb.sim b/tests/script/tsim/parser/limit1_tb.sim index 5a7c1bc201..82914f3011 100644 --- a/tests/script/tsim/parser/limit1_tb.sim +++ b/tests/script/tsim/parser/limit1_tb.sim @@ -370,7 +370,8 @@ sql select top(c1, 1) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 1 if $rows != 0 then return -1 endi -sql select top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu limit 3 offset 1 + +sql select ts, top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts limit 3 offset 1 if $rows != 3 then return -1 endi @@ -392,6 +393,7 @@ endi if $data21 != 9 then return -1 endi + sql select top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu limit 3 offset 5 if $rows != 0 then return -1 @@ -401,7 +403,8 @@ sql select bottom(c1, 1) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset if $rows != 0 then return -1 endi -sql select bottom(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu limit 3 offset 1 + +sql select ts, bottom(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts limit 3 offset 1 if $rows != 3 then return -1 endi diff --git a/tests/script/tsim/parser/limit2.sim b/tests/script/tsim/parser/limit2.sim index ca308fa6e7..3951ab4e08 100644 --- a/tests/script/tsim/parser/limit2.sim +++ b/tests/script/tsim/parser/limit2.sim @@ -61,11 +61,10 @@ while $i < $halfNum endw print ====== tables created -#run tsim/parser/limit2_query.sim +run tsim/parser/limit2_query.sim print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 100 system sh/exec.sh -n dnode1 -s start print ================== server restart completed diff --git a/tests/script/tsim/parser/limit2_query.sim b/tests/script/tsim/parser/limit2_query.sim index 8a2da7988d..0200cf7d43 100644 --- a/tests/script/tsim/parser/limit2_query.sim +++ b/tests/script/tsim/parser/limit2_query.sim @@ -27,8 +27,8 @@ print select count(*) from $stb where t1 > $val1 and t1 < $val2 group by t1, t2, sql select count(*), t1, t2, t3, t4, t5, t6 from $stb where t1 > $val1 and t1 < $val2 group by t1, t2, t3, t4, t5, t6 order by t1 asc limit 1 offset 0 $val = $tbNum - 3 -print $rows $val -if $rows != $val then +print $rows +if $rows != 1 then return -1 endi if $data00 != $rowNum then @@ -51,7 +51,7 @@ if $data05 != 2 then return -1 endi -sql select count(*) from $stb where t2 like '%' and t1 > 2 and t1 < 5 group by t3, t4 order by t3 desc limit 1 offset 0 +sql select count(*), t3, t4 from $stb where t2 like '%' and t1 > 2 and t1 < 5 group by t3, t4 order by t3 desc limit 2 offset 0 if $rows != 2 then return -1 endi @@ -70,15 +70,17 @@ endi if $data12 != 3 then return -1 endi + sql select count(*) from $stb where t2 like '%' and t1 > 2 and t1 < 5 group by t3, t4 order by t3 desc limit 1 offset 1 -if $rows != 0 then +if $rows != 1 then return -1 endi + ## TBASE-348 sql_error select count(*) from $stb where t1 like 1 ##### aggregation on tb + where + fill + limit offset -sql select max(c1) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) limit 10 offset 1 +sql select _wstart, max(c1) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) limit 10 offset 1 if $rows != 10 then return -1 endi diff --git a/tests/script/tsim/parser/limit_tb.sim b/tests/script/tsim/parser/limit_tb.sim index d0d14c5bfc..f8a1e7ac6a 100644 --- a/tests/script/tsim/parser/limit_tb.sim +++ b/tests/script/tsim/parser/limit_tb.sim @@ -358,8 +358,8 @@ endi print ========> TD-6017 sql select * from (select ts, top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1) -sql select top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1 -print select top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1 +sql select ts, top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1 +print select ts, top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1 print $data00 $data01 print $data10 $data11 print $data20 $data21 @@ -386,7 +386,7 @@ if $data21 != 6 then return -1 endi -sql select top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts asc limit 3 offset 1 +sql select ts, top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts asc limit 3 offset 1 if $rows != 3 then return -1 endi @@ -418,7 +418,7 @@ sql select bottom(c1, 1) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset if $rows != 0 then return -1 endi -sql select bottom(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu limit 3 offset 1 +sql select ts, bottom(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts limit 3 offset 1 if $rows != 3 then return -1 endi @@ -482,7 +482,7 @@ endi if $data41 != 4 then return -1 endi -sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) limit 5 offset 1 +sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) limit 5 offset 1 if $rows != 5 then return -1 endi @@ -518,7 +518,7 @@ if $data41 != 5 then endi ## TBASE-334 -sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 2 offset 1 +sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 2 offset 1 if $rows != 2 then return -1 endi @@ -634,7 +634,8 @@ sql select stddev(c1), stddev(c2), stddev(c3), stddev(c4), stddev(c5), stddev(c6 if $rows != 0 then return -1 endi -sql select stddev(c1), stddev(c2), stddev(c3), stddev(c4), stddev(c5), stddev(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 5 offset 1 + +sql select _wstart, stddev(c1), stddev(c2), stddev(c3), stddev(c4), stddev(c5), stddev(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 5 offset 1 if $rows != 3 then return -1 endi @@ -670,6 +671,7 @@ endi if $data31 != 3 then return -1 endi + sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(27m) limit 5 offset 1 if $rows != 3 then return -1 @@ -707,7 +709,8 @@ sql select first(c1), first(c2), first(c3), first(c4), first(c5), first(c6) from if $rows != 0 then return -1 endi -sql select first(c1), first(c2), first(c3), first(c4), first(c5), first(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 3 offset 1 + +sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 3 offset 1 if $rows != 3 then return -1 endi @@ -721,7 +724,6 @@ if $data23 != 9.00000 then return -1 endi - sql select last(c1), last(c2), last(c3), last(c4), last(c5), last(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 5 offset 1 if $rows != 0 then return -1 diff --git a/tests/script/tsim/parser/projection_limit_offset.sim b/tests/script/tsim/parser/projection_limit_offset.sim index 5a96af2b3e..669ff3a179 100644 --- a/tests/script/tsim/parser/projection_limit_offset.sim +++ b/tests/script/tsim/parser/projection_limit_offset.sim @@ -62,8 +62,6 @@ while $i < $half $tstart = 100000 endw -sleep 100 - $i1 = 1 $i2 = 0 diff --git a/tests/script/tsim/parser/single_row_in_tb.sim b/tests/script/tsim/parser/single_row_in_tb.sim index 59a0552809..1bd53ad24e 100644 --- a/tests/script/tsim/parser/single_row_in_tb.sim +++ b/tests/script/tsim/parser/single_row_in_tb.sim @@ -28,7 +28,6 @@ run tsim/parser/single_row_in_tb_query.sim print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 500 system sh/exec.sh -n dnode1 -s start print ================== server restart completed diff --git a/tests/script/tsim/parser/slimit1.sim b/tests/script/tsim/parser/slimit1.sim index bb12bc32f1..19e69ba541 100644 --- a/tests/script/tsim/parser/slimit1.sim +++ b/tests/script/tsim/parser/slimit1.sim @@ -52,11 +52,9 @@ run tsim/parser/slimit1_query.sim print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 500 system sh/exec.sh -n dnode1 -s start print ================== server restart completed sql connect -sleep 100 run tsim/parser/slimit1_query.sim diff --git a/tests/script/tsim/parser/slimit1_query.sim b/tests/script/tsim/parser/slimit1_query.sim index 8e3a61bee6..7c7d255fe0 100644 --- a/tests/script/tsim/parser/slimit1_query.sim +++ b/tests/script/tsim/parser/slimit1_query.sim @@ -1,4 +1,3 @@ -sleep 100 sql connect $dbPrefix = slm_alt_tg_db diff --git a/tests/script/tsim/parser/slimit_alter_tags.sim b/tests/script/tsim/parser/slimit_alter_tags.sim index 53af0f3e84..e12a14e43a 100644 --- a/tests/script/tsim/parser/slimit_alter_tags.sim +++ b/tests/script/tsim/parser/slimit_alter_tags.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2 system sh/exec.sh -n dnode1 -s start -sleep 100 sql connect $dbPrefix = slm_alt_tg_db @@ -93,7 +89,6 @@ if $data02 != tb0 then return -1 endi -sleep 500 sql reset query cache sql select count(*), first(ts) from stb group by tg_added order by tg_added asc slimit 5 soffset 3 if $rows != 5 then @@ -171,11 +166,8 @@ endi print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 500 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql connect -sleep 100 sql use $db ### repeat above queries diff --git a/tests/script/tsim/parser/slimit_query.sim b/tests/script/tsim/parser/slimit_query.sim index 0a793f0611..7ee7c6355b 100644 --- a/tests/script/tsim/parser/slimit_query.sim +++ b/tests/script/tsim/parser/slimit_query.sim @@ -1,4 +1,3 @@ -sleep 100 sql connect $dbPrefix = slm_db diff --git a/tests/script/tsim/parser/union.sim b/tests/script/tsim/parser/union.sim index 95150616d1..8bafeff444 100644 --- a/tests/script/tsim/parser/union.sim +++ b/tests/script/tsim/parser/union.sim @@ -95,9 +95,6 @@ while $i < $tbNum $j = $j + 1 endw -print sleep 1sec. -sleep 100 - $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/tag/column.sim b/tests/script/tsim/tag/column.sim index c73999230f..f4e2e5b7fe 100644 --- a/tests/script/tsim/tag/column.sim +++ b/tests/script/tsim/tag/column.sim @@ -31,7 +31,7 @@ sql create table $tb using $mt tags( 0, '0' ) $i = 1 $tb = $tbPrefix . $i -sql create table $tb using $mt tags( 1, 1 ) +sql create table $tb using $mt tags( 1, '1' ) $i = 2 $tb = $tbPrefix . $i @@ -39,7 +39,7 @@ sql create table $tb using $mt tags( '2', '2' ) $i = 3 $tb = $tbPrefix . $i -sql create table $tb using $mt tags( '3', 3 ) +sql create table $tb using $mt tags( '3', '3' ) sql show tables if $rows != 4 then @@ -54,7 +54,7 @@ sql insert into $tb values(now, 0, '0') $i = 1 $tb = $tbPrefix . $i -sql insert into $tb values(now, 1, 1 ) +sql insert into $tb values(now, 1, '1' ) $i = 2 $tb = $tbPrefix . $i @@ -62,7 +62,7 @@ sql insert into $tb values(now, '2', '2') $i = 3 $tb = $tbPrefix . $i -sql insert into $tb values(now, '3', 3) +sql insert into $tb values(now, '3', '3') print =============== step4 sql select * from $mt where tgcol2 = '1' diff --git a/tests/script/tsim/tag/commit.sim b/tests/script/tsim/tag/commit.sim index 95ab2dbc7f..1a47fd838f 100644 --- a/tests/script/tsim/tag/commit.sim +++ b/tests/script/tsim/tag/commit.sim @@ -249,8 +249,8 @@ sql alter table $mt add tag tgcol6 binary(10) sql reset query cache sql alter table $tb set tag tgcol4=false -sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=6 +sql alter table $tb set tag tgcol5='5' +sql alter table $tb set tag tgcol6='6' sql reset query cache sql select * from $mt where tgcol5 = '5' @@ -321,7 +321,7 @@ if $data04 != 3 then return -1 endi -sql alter table $mt change tag tgcol1 tgcol4 +sql alter table $mt rename tag tgcol1 tgcol4 sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 bigint @@ -382,14 +382,14 @@ if $data04 != 3 then return -1 endi -sql alter table $mt change tag tgcol1 tgcol4 +sql alter table $mt rename tag tgcol1 tgcol4 sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 binary(17) sql alter table $mt add tag tgcol6 bool sql reset query cache sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol5='5' sql alter table $tb set tag tgcol6=1 sql reset query cache @@ -423,7 +423,7 @@ $i = 9 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10)) -sql create table $tb using $mt tags( 1, 2, '3' ) +sql create table $tb using $mt tags( 1, '2', '3' ) sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' if $rows != 1 then @@ -442,7 +442,7 @@ if $data04 != 3 then return -1 endi -sql alter table $mt change tag tgcol1 tgcol4 +sql alter table $mt rename tag tgcol1 tgcol4 sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 bool @@ -506,7 +506,7 @@ if $data05 != 4 then return -1 endi -sql alter table $mt change tag tgcol1 tgcol4 -x step103 +sql alter table $mt rename tag tgcol1 tgcol4 -x step103 return -1 step103: @@ -518,7 +518,7 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bool sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4='4' sql alter table $tb set tag tgcol5=false sql reset query cache @@ -580,7 +580,7 @@ if $data06 != 5 then return -1 endi -sql alter table $mt change tag tgcol1 tgcol4 -x step114 +sql alter table $mt rename tag tgcol1 tgcol4 -x step114 return -1 step114: @@ -596,9 +596,9 @@ sql alter table $mt add tag tgcol7 bigint sql alter table $mt add tag tgcol8 smallint sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4='4' sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=6 +sql alter table $tb set tag tgcol6='6' sql alter table $tb set tag tgcol7=7 sql alter table $tb set tag tgcol8=8 sql reset query cache @@ -685,11 +685,11 @@ sql alter table $mt add tag tgcol5 bigint sql reset query cache sql alter table $tb set tag tgcol1=false -sql alter table $tb set tag tgcol2=5 +sql alter table $tb set tag tgcol2='5' sql alter table $tb set tag tgcol3=4 -sql alter table $tb set tag tgcol4=3 +sql alter table $tb set tag tgcol4='3' sql alter table $tb set tag tgcol5=2 -sql alter table $tb set tag tgcol6=1 +sql alter table $tb set tag tgcol6='1' sql reset query cache sql select * from $mt where tgcol4 = '3' @@ -781,8 +781,8 @@ sql alter table $mt add tag tgcol4 int sql alter table $mt add tag tgcol6 bigint sql reset query cache -sql alter table $tb set tag tgcol1=7 -sql alter table $tb set tag tgcol2=8 +sql alter table $tb set tag tgcol1='7' +sql alter table $tb set tag tgcol2='8' sql alter table $tb set tag tgcol3=9 sql alter table $tb set tag tgcol4=10 sql alter table $tb set tag tgcol5=11 @@ -817,9 +817,7 @@ if $data07 != 12 then endi system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 3000 system sh/exec.sh -n dnode1 -s start -sleep 3000 print =============== step1 $i = 0