未验证 提交 4ab17055 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #8934 from taosdata/interp_case_develop

[TD-10739]<test>: add test case for interp
...@@ -8360,6 +8360,45 @@ class TDTestCase: ...@@ -8360,6 +8360,45 @@ class TDTestCase:
sql += "where ts >= '%s' AND ts <= '%s' range('%s' , '%s') EVERY(1s) FILL(NULL);" % (self.ts , self.ts + 10000 , self.ts + 150000 , self.ts + 200000) sql += "where ts >= '%s' AND ts <= '%s' range('%s' , '%s') EVERY(1s) FILL(NULL);" % (self.ts , self.ts + 10000 , self.ts + 150000 , self.ts + 200000)
datacheck = tdSql.error(sql) datacheck = tdSql.error(sql)
# TD-10736 Exception use case for coredump
tdSql.execute("create database db_except;")
tdSql.execute("use db_except;")
tdSql.execute("create table tb (ts timestamp, c1 int);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:00.000' ,1);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:01.000' ,2);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:02.000' ,3);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:03.000' ,4);")
tdSql.execute("create stable stb (ts timestamp, c1 int) tags (id int);")
tdSql.execute("insert into sub_1 using stb tags (1) values ('2021-10-01 08:00:00.000' ,1);")
tdSql.execute("insert into sub_1 using stb tags (1) values ('2021-10-01 08:00:01.000' ,2);")
tdSql.execute("insert into sub_2 using stb tags (1) values ('2021-10-01 08:00:00.000' ,3);")
tdSql.execute("insert into sub_2 using stb tags (1) values ('2021-10-01 08:00:01.000' ,4);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:01.000' ,1);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:02.000' ,2);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:03.000' ,3);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:04.000' ,4);")
tdSql.query("select interp(c1) from tb where ts = '2021-10-01 08:00:00.000' every(1s); ")
tdSql.checkData(0,1,1)
tdSql.query("select interp(c1) from tb where ts = '2021-10-01 08:00:98.000' every(1s); ")
tdSql.checkRows(0)
tdSql.query("select interp(c1) from sub_1 where ts = '2021-10-01 08:00:00.000' every(1s); ")
tdSql.checkData(0,1,1)
tdSql.query("select interp(c1) from sub_1 where ts = '2021-10-01 08:00:98.000' every(1s); ")
tdSql.checkRows(0)
tdSql.error("select interp(c1) from stb where ts = '2021-10-01 08:00:00.000' every(1s); ")
tdSql.error("select interp(c1) from stb where ts = '2021-10-01 08:00:98.000' every(1s); ")
tdSql.query("select interp(c1) from stb where ts = '2021-10-01 08:00:00.000' every(1s) group by tbname; ")
tdSql.checkRows(2)
tdSql.query("select interp(c1) from stb where ts = '2021-10-01 08:00:98.000' every(1s) group by tbname; ")
tdSql.checkRows(0)
# Nested Query + where + range + FILL(NULL) + EVERY( s)(3) # Nested Query + where + range + FILL(NULL) + EVERY( s)(3)
# sql = "select * from (select %s from stable_1 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z1," % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000) # sql = "select * from (select %s from stable_1 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z1," % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000)
# sql += "(select %s from stable_2 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z2 where z1.ts=z2.ts ;" % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000) # sql += "(select %s from stable_2 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z2 where z1.ts=z2.ts ;" % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册