From e1442f96190c28d95978646a894104412db29d4b Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 19 Apr 2021 18:00:32 +0800 Subject: [PATCH] [td-225]add test cases. --- .../general/parser/first_last_query.sim | 48 ++++++++++++++++++- tests/tsim/src/simSystem.c | 1 - 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/tests/script/general/parser/first_last_query.sim b/tests/script/general/parser/first_last_query.sim index 2d08759f3f..2dff1dd51b 100644 --- a/tests/script/general/parser/first_last_query.sim +++ b/tests/script/general/parser/first_last_query.sim @@ -269,4 +269,50 @@ if $data14 != @test2@ then return -1 endi -sql drop table stest \ No newline at end of file +sql drop table stest + +print ===================>td-3779 +sql create table m1(ts timestamp, k int) tags(a int); +sql create table tm0 using m1 tags(1); +sql create table tm1 using m1 tags(2); +sql insert into tm0 values('2020-3-1 1:1:1', 112); +sql insert into tm1 values('2020-1-1 1:1:1', 1)('2020-3-1 0:1:1', 421); +system sh/exec.sh -n dnode1 -s stop -x SIGINT +sleep 1000 + +system sh/exec.sh -n dnode1 -s start +print ================== server restart completed +sleep 1000 +sql connect +sql use first_db0; + +sql select last(*) from m1 group by tbname; +if $rows != 2 then + return -1 +endi + +if $data00 != @20-03-01 01:01:01.000@ then + return -1 +endi + +if $data01 != 112 then + return -1 +endi + +if $data02 != @tm0@ then + return -1 +endi + +if $data10 != @20-03-01 00:01:01.000@ then + return -1 +endi + +if $data11 != 421 then + return -1 +endi + +if $data12 != @tm1@ then + return -1 +endi + +sql drop table m1 \ No newline at end of file diff --git a/tests/tsim/src/simSystem.c b/tests/tsim/src/simSystem.c index d2494eddbb..dda1e133de 100644 --- a/tests/tsim/src/simSystem.c +++ b/tests/tsim/src/simSystem.c @@ -164,7 +164,6 @@ void *simExecuteScript(void *inputScript) { } if (script->killed || script->linePos >= script->numOfLines) { - printf("killed ---------------------->\n"); script = simProcessCallOver(script); if (script == NULL) { printf("abort now!\n"); -- GitLab