From 7039e60bd468d668e990f67951912a18047a37e2 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Fri, 29 Apr 2022 10:53:52 +0800 Subject: [PATCH] only one ts column when sample on interval or session window --- tests/develop-test/2-query/TD-14745.py | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/develop-test/2-query/TD-14745.py diff --git a/tests/develop-test/2-query/TD-14745.py b/tests/develop-test/2-query/TD-14745.py new file mode 100644 index 0000000000..f5360ee91b --- /dev/null +++ b/tests/develop-test/2-query/TD-14745.py @@ -0,0 +1,43 @@ +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-13946]core dump of sampling binary column so that when result from vnode exceeds INT16_MAX bytes + ''' + 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 td14745") + tdSql.execute("create database td14745") + tdSql.execute("use td14745") + + tdSql.execute("create table st ( ts timestamp, i int) tags (t1 int)") + tdSql.execute("create table ct1 using st tags(1)") + + for i in range(100): + tdSql.execute("insert into ct1 values(now+{}a, {})".format(100*i, i)) + + tdSql.query("select sample(i,3) from ct1 interval(1s)") + tdSql.checkCols(2) + + tdSql.query("select sample(i,3) from ct1 session(ts, 200a)") + tdSql.checkCols(2) + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) + -- GitLab