From 2d867d1c392198724f126a450447be2faed666e1 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Wed, 15 Dec 2021 17:08:23 +0800 Subject: [PATCH] enhance test case --- tests/script/general/parser/nestquery.sim | 145 +++++++++++++++++++++- 1 file changed, 141 insertions(+), 4 deletions(-) diff --git a/tests/script/general/parser/nestquery.sim b/tests/script/general/parser/nestquery.sim index 1adca89897..a721e19b99 100644 --- a/tests/script/general/parser/nestquery.sim +++ b/tests/script/general/parser/nestquery.sim @@ -963,11 +963,148 @@ sql select sum(value) from (select diff(voltage) value from meters2 group by tbn sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts; sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts desc; -sleep 100 -sql connect -sql use td11097 - $emptyString = @@ +print execute sql select diff(voltage) value from meters2 group by tbname; +sql select diff(voltage) value from meters2 group by tbname; +if $data00 != @21-12-15 16:21:26.000@ then + return -1 +endi +if $data01 != @1@ then + return -1 +endi +if $data02 != @d001@ then + return -1 +endi +if $data10 != @21-12-15 16:22:26.000@ then + return -1 +endi +if $data11 != @2@ then + return -1 +endi +if $data12 != @d001@ then + return -1 +endi +if $data20 != @21-12-15 16:24:26.000@ then + return -1 +endi +if $data21 != @4@ then + return -1 +endi +if $data22 != @d001@ then + return -1 +endi +if $data30 != @21-12-15 16:40:26.000@ then + return -1 +endi +if $data31 != @-7@ then + return -1 +endi +if $data32 != @d001@ then + return -1 +endi +if $data40 != @21-12-15 16:21:26.000@ then + return -1 +endi +if $data41 != @42@ then + return -1 +endi +if $data42 != @d002@ then + return -1 +endi +if $data50 != @21-12-15 16:23:26.000@ then + return -1 +endi +if $data51 != @-6@ then + return -1 +endi +if $data52 != @d002@ then + return -1 +endi +if $data60 != @21-12-15 16:41:26.000@ then + return -1 +endi +if $data61 != @-36@ then + return -1 +endi +if $data62 != @d002@ then + return -1 +endi +print execute sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) ; +sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) ; +if $data00 != @21-12-15 16:21:00.000@ then + return -1 +endi +if $data01 != @43@ then + return -1 +endi +if $data10 != @21-12-15 16:22:00.000@ then + return -1 +endi +if $data11 != @2@ then + return -1 +endi +if $data20 != @21-12-15 16:23:00.000@ then + return -1 +endi +if $data21 != @-6@ then + return -1 +endi +if $data30 != @21-12-15 16:24:00.000@ then + return -1 +endi +if $data31 != @4@ then + return -1 +endi +if $data40 != @21-12-15 16:40:00.000@ then + return -1 +endi +if $data41 != @-7@ then + return -1 +endi +if $data50 != @21-12-15 16:41:00.000@ then + return -1 +endi +if $data51 != @-36@ then + return -1 +endi +print execute sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts; +sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts; +if $data00 != @21-12-15 16:21:00.000@ then + return -1 +endi +if $data01 != @43@ then + return -1 +endi +if $data10 != @21-12-15 16:22:00.000@ then + return -1 +endi +if $data11 != @2@ then + return -1 +endi +if $data20 != @21-12-15 16:23:00.000@ then + return -1 +endi +if $data21 != @-6@ then + return -1 +endi +if $data30 != @21-12-15 16:24:00.000@ then + return -1 +endi +if $data31 != @4@ then + return -1 +endi +if $data40 != @21-12-15 16:40:00.000@ then + return -1 +endi +if $data41 != @-7@ then + return -1 +endi +if $data50 != @21-12-15 16:41:00.000@ then + return -1 +endi +if $data51 != @-36@ then + return -1 +endi print execute sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts desc; sql select sum(value) from (select diff(voltage) value from meters2 group by tbname) interval(1m) order by ts desc; if $data00 != @21-12-15 16:41:00.000@ then -- GitLab