未验证 提交 20cf2ff3 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #8751 from taosdata/fix/TS-426-D

fixed TS-426 on develop. group by can not ignore NULL
...@@ -1578,9 +1578,6 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn ...@@ -1578,9 +1578,6 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn
int32_t num = 0; int32_t num = 0;
for (int32_t j = 0; j < pSDataBlock->info.rows; ++j) { for (int32_t j = 0; j < pSDataBlock->info.rows; ++j) {
char* val = ((char*)pColInfoData->pData) + bytes * 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. // Compare with the previous row of this column, and do not set the output buffer again if they are identical.
if (pInfo->prevData == NULL) { if (pInfo->prevData == NULL) {
......
...@@ -42,22 +42,22 @@ class TDTestCase: ...@@ -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)) % (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.query("select count(*),last(*) from stest group by col1")
tdSql.checkRows(10) tdSql.checkRows(11)
tdSql.checkData(0, 0, 1) tdSql.checkData(1, 0, 1)
tdSql.checkData(1, 2, 2) tdSql.checkData(2, 2, 2)
tdSql.checkData(1, 3, 1) tdSql.checkData(2, 3, 1)
tdSql.query("select count(*),last(*) from stest group by col2") tdSql.query("select count(*),last(*) from stest group by col2")
tdSql.checkRows(1) tdSql.checkRows(2)
tdSql.checkData(0, 0, 10) tdSql.checkData(1, 0, 10)
tdSql.checkData(0, 2, 10) tdSql.checkData(1, 2, 10)
tdSql.checkData(0, 3, 1) tdSql.checkData(1, 3, 1)
tdSql.query("select count(*),last(ts,stest.*) from stest group by col1") tdSql.query("select count(*),last(ts,stest.*) from stest group by col1")
tdSql.checkRows(10) tdSql.checkRows(11)
tdSql.checkData(0, 0, 1) tdSql.checkData(1, 0, 1)
tdSql.checkData(0, 2, "2018-09-17 09:00:00") tdSql.checkData(1, 2, "2018-09-17 09:00:00")
tdSql.checkData(1, 4, 1) tdSql.checkData(2, 4, 1)
......
...@@ -561,19 +561,19 @@ endi ...@@ -561,19 +561,19 @@ endi
sql_error select first(c6) - last(c6) *12 / count(*) from $stb group by c3; 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; sql select first(c6) - last(c6) *12 / count(*) from $stb group by c5;
if $rows != 10 then if $rows != 11 then
return -1 return -1
endi endi
if $data00 != 0.000000000 then if $data00 != -0.002160000 then
return -1 return -1
endi endi
if $data10 != 0.997600000 then if $data10 != 0.000000000 then
return -1 return -1
endi endi
if $data90 != 8.978400000 then if $data90 != 7.980800000 then
return -1 return -1
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册