From 86f1d527a7af744e6369ea691656c91b875404e8 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Fri, 29 Apr 2022 10:01:14 +0800 Subject: [PATCH] add test case --- tests/develop-test/2-query/TD-14763.py | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/develop-test/2-query/TD-14763.py diff --git a/tests/develop-test/2-query/TD-14763.py b/tests/develop-test/2-query/TD-14763.py new file mode 100644 index 0000000000..e1c82e3ebf --- /dev/null +++ b/tests/develop-test/2-query/TD-14763.py @@ -0,0 +1,47 @@ +import sys +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import tdDnodes +from math import inf + +class TDTestCase: + def caseDescription(self): + ''' + case1: [TD-14763]csum can not be used on state window + ''' + return + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + self._conn = conn + + def run(self): + print("running {}".format(__file__)) + tdSql.execute("drop database if exists td14763") + tdSql.execute("create database td14763") + tdSql.execute("use td14763") + + tdSql.execute("create table st ( ts timestamp, i int, b bool) tags (t1 int)") + tdSql.execute("create table ct1 using st tags(1)") + tdSql.execute("create table ct2 using st tags(2)") + + for i in range(0, 4000, 2): + b = True if i%3 == 0 else False + tdSql.execute("insert into ct1 values(now + {}a, {}, {})".format(i, i, b)) + tdSql.execute("insert into ct2 values(now + {}a, {}, {})".format(i+1, i+1, b)) + + tdSql.error("select csum(i) from ct1 state_window(b)") + tdSql.error("select csum(i) from (select * from st) state_window(b)") + tdSql.query("select csum(i) from ct1"); + + tdSql.execute('drop database td14763') + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) + -- GitLab