未验证 提交 5882980f 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #7863 from taosdata/xiaoping/test_case

[TS-337]<test>: add test case for interp function returns empty result
......@@ -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__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册