[td-225]fix the bug found by regression test.

This commit is contained in:
Haojun Liao 2021-04-30 13:58:33 +08:00
parent fdfb7b58f1
commit 9d217d864f
2 changed files with 5 additions and 3 deletions

View File

@ -1094,7 +1094,6 @@ SSDataBlock* doGlobalAggregate(void* param, bool* newgroup) {
{
if (pAggInfo->hasDataBlockForNewGroup) {
pAggInfo->binfo.pRes->info.rows = 0;
pAggInfo->hasPrev = false; // now we start from a new group data set.
// not belongs to the same group, return the result of current group;

View File

@ -4578,9 +4578,12 @@ SArray* getOrderCheckColumns(SQueryAttr* pQuery) {
for(int32_t i = 0; i < numOfCols; ++i) {
SColIndex* index = taosArrayGet(pOrderColumns, i);
for(int32_t j = 0; j < pQuery->numOfOutput; ++j) {
if (index->colId == pQuery->pExpr1[j].base.colInfo.colId) {
SSqlExpr* pExpr = &pQuery->pExpr1[j].base;
int32_t functionId = pExpr->functionId;
if (index->colId == pExpr->colInfo.colId && (functionId == TSDB_FUNC_PRJ || functionId == TSDB_FUNC_TAG)) {
index->colIndex = j;
index->colId = pQuery->pExpr1[j].base.resColId;
index->colId = pExpr->resColId;
}
}
}