From 2edee69b166299ae97c1cf1d46511675c42bb81d Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Thu, 13 Jul 2023 18:49:24 +0800 Subject: [PATCH] add test cases --- tests/script/tsim/parser/fill.sim | 81 +++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/tests/script/tsim/parser/fill.sim b/tests/script/tsim/parser/fill.sim index 0510f80419..a66e7d6ab7 100644 --- a/tests/script/tsim/parser/fill.sim +++ b/tests/script/tsim/parser/fill.sim @@ -1143,4 +1143,85 @@ if $rows != 20026 then return -1 endi +print ===================== TD-25209 test fill prev/next/linear after data range +sql use $db + +sql select _wstart,_wend,count(*) from tm0 where ts >= '2020-01-01 01:03:06.000' and ts <= '2020-01-01 01:03:10.000' interval(1s) fill(prev); + +if $rows != 5 then + return -1 +endi + +if $data02 != NULL then + return -1 +endi + +if $data12 != 1 then + return -1 +endi + +if $data22 != 1 then + return -1 +endi + +if $data32 != 1 then + return -1 +endi + +if $data42 != 1 then + return -1 +endi + +sql select _wstart,_wend,count(*) from tm0 where ts >= '2020-01-01 01:03:06.000' and ts <= '2020-01-01 01:03:10.000' interval(1s) fill(next); + +if $rows != 5 then + return -1 +endi + +if $data02 != 1 then + return -1 +endi + +if $data12 != 1 then + return -1 +endi + +if $data22 != 1 then + return -1 +endi + +if $data32 != 1 then + return -1 +endi + +if $data42 != NULL then + return -1 +endi + +sql select _wstart,_wend,count(*) from tm0 where ts >= '2020-01-01 01:03:06.000' and ts <= '2020-01-01 01:03:10.000' interval(1s) fill(linear); + +if $rows != 5 then + return -1 +endi + +if $data02 != NULL then + return -1 +endi + +if $data12 != 1 then + return -1 +endi + +if $data22 != 1 then + return -1 +endi + +if $data32 != 1 then + return -1 +endi + +if $data42 != NULL then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT -- GitLab