[TD-4733]<test>: add test case for derivative function

This commit is contained in:
Ping Xiao 2021-06-17 17:29:25 +08:00
parent 4066fb7c50
commit 958d2454df
1 changed files with 8 additions and 1 deletions

View File

@ -130,6 +130,13 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
self.insertAndCheckData() self.insertAndCheckData()
tdSql.execute("create table st(ts timestamp, c1 int, c2 int) tags(id int)")
tdSql.execute("insert into dev1(ts, c1) using st tags(1) values(now, 1)")
tdSql.error("select derivative(c1, 10s, 0) from (select c1 from st)")
tdSql.query("select diff(c1) from (select derivative(c1, 1s, 0) c1 from dev1)")
tdSql.checkRows(0)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)