提交 603cc794 编写于 作者: C Cary Xu

Merge branch 'master' into hotfix/TS-714

......@@ -1713,9 +1713,6 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn
int32_t num = 0;
for (int32_t j = 0; j < pSDataBlock->info.rows; ++j) {
char* val = ((char*)pColInfoData->pData) + bytes * j;
if (isNull(val, type)) {
continue;
}
// Compare with the previous row of this column, and do not set the output buffer again if they are identical.
if (pInfo->prevData == NULL) {
......
......@@ -42,22 +42,22 @@ class TDTestCase:
% (self.ts + i, i + 1, 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.query("select count(*),last(*) from stest group by col1")
tdSql.checkRows(10)
tdSql.checkData(0, 0, 1)
tdSql.checkData(1, 2, 2)
tdSql.checkData(1, 3, 1)
tdSql.checkRows(11)
tdSql.checkData(1, 0, 1)
tdSql.checkData(2, 2, 2)
tdSql.checkData(2, 3, 1)
tdSql.query("select count(*),last(*) from stest group by col2")
tdSql.checkRows(1)
tdSql.checkData(0, 0, 10)
tdSql.checkData(0, 2, 10)
tdSql.checkData(0, 3, 1)
tdSql.checkRows(2)
tdSql.checkData(1, 0, 10)
tdSql.checkData(1, 2, 10)
tdSql.checkData(1, 3, 1)
tdSql.query("select count(*),last(ts,stest.*) from stest group by col1")
tdSql.checkRows(10)
tdSql.checkData(0, 0, 1)
tdSql.checkData(0, 2, "2018-09-17 09:00:00")
tdSql.checkData(1, 4, 1)
tdSql.checkRows(11)
tdSql.checkData(1, 0, 1)
tdSql.checkData(1, 2, "2018-09-17 09:00:00")
tdSql.checkData(2, 4, 1)
......
......@@ -488,7 +488,7 @@ class TDTestCase:
tdLog.info(len(sql))
tdSql.query(sql)
#tdSql.checkData(0,0,'2020-09-13 20:26:40.000')
tdSql.checkRows(6*self.num)
tdSql.checkRows(6*self.num)
#1 outer union not support
#dcDB = self.dropandcreateDB(random.randint(1,3))
......@@ -2164,6 +2164,68 @@ class TDTestCase:
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-4 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from regular_table_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s ) " % random.choice(interval_sliding)
sql += "group by ts "
sql += "%s ;" % random.choice(limit_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-5 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from table_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s ) " % random.choice(interval_sliding)
sql += "group by ts "
sql += "%s ;" % random.choice([limit_where[2] , limit_where[3]] )
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-6 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from stable_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s ) " % random.choice(interval_sliding)
sql += "group by ts "
sql += "%s ;" % random.choice(limit_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 21-7 from table_0;")
for i in range(self.fornum):
sql = "select avg(res1),min(res2),max(res3) from ( select "
sql += "%s res1, " % random.choice(calc_aggregate_all)
sql += "%s res2," % random.choice(calc_aggregate_all)
sql += "%s res3 " % random.choice(calc_aggregate_all)
sql += " from stable_1 t1 "
sql += " where %s " % random.choice(q_where)
sql += " %s " % random.choice(interval_sliding)
sql += " %s ) " % random.choice(group_where)
sql += "group by ts "
sql += "%s ;" % random.choice(limit_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
# error
#1 select * from (select * from (select * form regular_table where <\>\in\and\or order by limit ))
tdSql.query("select 1-1 from table_1;")
......
......@@ -553,19 +553,19 @@ endi
sql_error select first(c6) - last(c6) *12 / count(*) from $stb group by c3;
sql select first(c6) - last(c6) *12 / count(*) from $stb group by c5;
if $rows != 10 then
if $rows != 11 then
return -1
endi
if $data00 != 0.000000000 then
if $data00 != -0.002160000 then
return -1
endi
if $data10 != 0.997600000 then
if $data10 != 0.000000000 then
return -1
endi
if $data90 != 8.978400000 then
if $data90 != 7.980800000 then
return -1
endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册