提交 592252af 编写于 作者: P Ping Xiao

[TS-795]<test>: add test case

上级 439b7377
......@@ -116,10 +116,41 @@ class TDTestCase:
sql += f"union all select last(*) from sub{i} "
tdSql.execute("create table sub%d using st2 tags('nchar%d')" % (i, i))
tdSql.execute("insert into sub%d values(%d, %d, %d, %d)" % (i, self.ts + i, i, i, i))
tdSql.execute("insert into sub%d values(%d, %d, %d, %d)(%d, %d, %d, %d)" % (i, self.ts + i, i, i, i,self.ts + i + 101, i + 101, i + 101, i + 101))
tdSql.error(sql)
# TS-795
tdLog.info("test case for TS-795")
functions = ["*", "count", "avg", "twa", "irate", "sum", "stddev", "leastsquares", "min", "max", "first", "last", "top", "bottom", "percentile", "apercentile", "last_row"]
for func in functions:
expr = func
if func == "top" or func == "bottom":
expr += "(c1, 1)"
elif func == "percentile" or func == "apercentile":
expr += "(c1, 0.5)"
elif func == "leastsquares":
expr = func + "(c1, 1, 1)"
elif func == "*":
expr = func
else:
expr += "(c1)"
for i in range(100):
if i == 0:
sql = f"select {expr} from sub0 "
else:
sql += f"union all select {expr} from sub{i} "
tdSql.query(sql)
if func == "*":
tdSql.checkRows(200)
else:
tdSql.checkRows(100)
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.
先完成此消息的编辑!
想要评论请 注册