diff --git a/tests/pytest/functions/function_interp.py b/tests/pytest/functions/function_interp.py index 87d001d9e586fdfccb28e6fe9c8a04510d6f3fb1..c7a56d59d9c1d33e32e892cb5c6d8746e926bd30 100644 --- a/tests/pytest/functions/function_interp.py +++ b/tests/pytest/functions/function_interp.py @@ -12,6 +12,7 @@ # -*- coding: utf-8 -*- import sys +from util.dnodes import * import taos from util.log import * from util.cases import * @@ -25,7 +26,7 @@ class TDTestCase: tdSql.init(conn.cursor()) self.rowNum = 10 - self.ts = 1537146000000 + self.ts = 1537100000000 def run(self): tdSql.prepare() @@ -90,6 +91,30 @@ class TDTestCase: tdSql.error("select interp(*) from ap1 ts <= '2021-07-25 02:19:54' FILL(NEXT)") tdSql.error("select interp(*) from ap1 where ts >'2021-07-25 02:19:59.938' and ts < now every(1s) fill(next)") + # test case for https://jira.taosdata.com:18080/browse/TS-241 + tdSql.execute("create database test minrows 10") + tdSql.execute("use test") + tdSql.execute("create table st(ts timestamp, c1 int) tags(id int)") + tdSql.execute("create table t1 using st tags(1)") + + for i in range(10): + for j in range(10): + tdSql.execute("insert into t1 values(%d, %d)" % (self.ts + i * 3600000 + j, j)) + tdSql.query("select interp(c1) from st where ts >= '2018-09-16 20:00:00.000' and ts <= '2018-09-17 06:00:00.000' every(1h) fill(linear)") + if i==0: + tdSql.checkRows(0) + else: + tdSql.checkRows(11) + + tdDnodes.stop(1) + tdDnodes.start(1) + tdSql.query("select interp(c1) from st where ts >= '2018-09-16 20:00:00.000' and ts <= '2018-09-17 06:00:00.000' every(1h) fill(linear)") + if i==0: + tdSql.checkRows(0) + else: + tdSql.checkRows(11) + + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__)