提交 8c901e1c 编写于 作者: Z zhihaop

Merge branch '2.6' into improve/taosc-async-enhancement-for-2.6

Subproject commit e7270c90fd1888842a45d47700040d3f86ebaf5f Subproject commit 9e75540e6dd9140cc551735beb177ec6afe9f3cc
...@@ -92,6 +92,7 @@ typedef struct SResultRow { ...@@ -92,6 +92,7 @@ typedef struct SResultRow {
char *key; // start key of current result row char *key; // start key of current result row
SHashObj *uniqueHash; // for unique function SHashObj *uniqueHash; // for unique function
SHashObj *modeHash; // for unique function SHashObj *modeHash; // for unique function
int32_t groupIndex; // index in group result
} SResultRow; } SResultRow;
typedef struct SResultRowCell { typedef struct SResultRowCell {
......
此差异已折叠。
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
import sys import sys
import taos import taos
import numpy as np
from util.log import tdLog from util.log import tdLog
from util.cases import tdCases from util.cases import tdCases
from util.sql import tdSql from util.sql import tdSql
...@@ -162,6 +163,39 @@ class TDTestCase: ...@@ -162,6 +163,39 @@ class TDTestCase:
tdSql.error("select twa(c) from tb group by c") tdSql.error("select twa(c) from tb group by c")
# TD-14678
tdSql.execute("create database test4")
tdSql.execute("use test4")
tdSql.execute("create table stb(ts timestamp, c int) tags(t1 int)")
ts = 1630000000000
sql = "insert into t1 using stb tags(1) values"
for i in range(100):
sql += "(%d, %d)" % (ts + i * 1000, i % 100)
tdSql.execute(sql)
tdSql.query("select COUNT(*) from stb interval(13m) sliding(3m) group by tbname order by ts desc")
tdSql.checkData(0, 1, 20)
tdSql.checkData(1, 1, 100)
tdSql.checkData(2, 1, 100)
tdSql.checkData(3, 1, 100)
tdSql.checkData(4, 1, 100)
tdSql.query("select COUNT(*) from stb interval(13m) sliding(3m) group by tbname order by ts")
tdSql.checkData(0, 1, 100)
tdSql.checkData(1, 1, 100)
tdSql.checkData(2, 1, 100)
tdSql.checkData(3, 1, 100)
tdSql.checkData(4, 1, 20)
# TD-14698
tdSql.query("select SPREAD(_c0) from (select * from stb) where ts between 1630000001000 and 1630100001000 interval(12h) Fill(NULL) order by ts")
matrix = np.array(tdSql.queryResult)
list = matrix[:, 0]
if all(sorted(list) == list):
tdLog.info("sql:%s, column : ts is sorted in accending order as expected" % (tdSql.sql))
else:
tdLog.exit("sql:%s, column : ts is not sorted in accending order as expected" % (tdSql.sql))
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -121,6 +121,9 @@ class TDTestCase: ...@@ -121,6 +121,9 @@ class TDTestCase:
tdSql.query("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_t.id, stb_p.dscrption, stb_p.pressure from stb_p, stb_t where stb_p.ts=stb_t.ts and stb_p.id = stb_t.id") tdSql.query("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_t.id, stb_p.dscrption, stb_p.pressure from stb_p, stb_t where stb_p.ts=stb_t.ts and stb_p.id = stb_t.id")
tdSql.checkRows(6) tdSql.checkRows(6)
tdSql.query("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_t.id, stb_p.dscrption, stb_p.pressure from stb_p, stb_t where stb_p.ts=stb_t.ts and stb_p.id = stb_t.id order by ts desc limit 1 offset 1")
tdSql.checkRows(1)
tdSql.error("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_t.pid, stb_p.id, stb_p.dscrption, stb_p.pressure,stb_v.velocity from stb_p, stb_t, stb_v where stb_p.ts=stb_t.ts and stb_p.ts=stb_v.ts and stb_p.id = stb_t.id") tdSql.error("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_t.pid, stb_p.id, stb_p.dscrption, stb_p.pressure,stb_v.velocity from stb_p, stb_t, stb_v where stb_p.ts=stb_t.ts and stb_p.ts=stb_v.ts and stb_p.id = stb_t.id")
# test case for https://jira.taosdata.com:18080/browse/TD-1250 # test case for https://jira.taosdata.com:18080/browse/TD-1250
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册