Merge pull request #5988 from taosdata/fix/develop
[td-255]fix bug found by regression test.
This commit is contained in:
commit
a915c29cbc
|
@ -4466,13 +4466,18 @@ SArray* getOrderCheckColumns(SQueryAttr* pQuery) {
|
||||||
for(int32_t i = 0; i < numOfCols; ++i) {
|
for(int32_t i = 0; i < numOfCols; ++i) {
|
||||||
SColIndex* index = taosArrayGet(pOrderColumns, i);
|
SColIndex* index = taosArrayGet(pOrderColumns, i);
|
||||||
for(int32_t j = 0; j < pQuery->numOfOutput; ++j) {
|
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 || functionId == TSDB_FUNC_TS)) {
|
||||||
index->colIndex = j;
|
index->colIndex = j;
|
||||||
index->colId = pQuery->pExpr1[j].base.resColId;
|
index->colId = pExpr->resColId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pOrderColumns;
|
return pOrderColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4804,7 +4809,7 @@ static SSDataBlock* doArithmeticOperation(void* param, bool* newgroup) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return result of the previous group in the firstly.
|
// Return result of the previous group in the firstly.
|
||||||
if (newgroup && pRes->info.rows > 0) {
|
if (*newgroup && pRes->info.rows > 0) {
|
||||||
pArithInfo->existDataBlock = pBlock;
|
pArithInfo->existDataBlock = pBlock;
|
||||||
clearNumOfRes(pInfo->pCtx, pOperator->numOfOutput);
|
clearNumOfRes(pInfo->pCtx, pOperator->numOfOutput);
|
||||||
return pInfo->pRes;
|
return pInfo->pRes;
|
||||||
|
|
Loading…
Reference in New Issue