提交 6216f6c5 编写于 作者: H Haojun Liao

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

上级 006d59bf
...@@ -4466,13 +4466,18 @@ SArray* getOrderCheckColumns(SQueryAttr* pQuery) { ...@@ -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) { ...@@ -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;
......
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
......
...@@ -55,4 +55,5 @@ run general/parser/sliding.sim ...@@ -55,4 +55,5 @@ run general/parser/sliding.sim
run general/parser/function.sim run general/parser/function.sim
run general/parser/stableOp.sim run general/parser/stableOp.sim
run general/parser/having.sim run general/parser/having.sim
run general/parser/having_child.sim run general/parser/having_child.sim
\ No newline at end of file run general/parser/binary_escapeCharacter.sim
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册