提交 bc61dc04 编写于 作者: X Xiaoyu Wang

[TD-10776]<fix>: Handle the case where the data is filtered inside the doGetDataBlock function.

上级 1192a9c1
...@@ -919,23 +919,31 @@ SSDataBlock* doGetDataBlock(void* param, bool* newgroup) { ...@@ -919,23 +919,31 @@ SSDataBlock* doGetDataBlock(void* param, bool* newgroup) {
pBlock->info.rows = pRes->numOfRows; pBlock->info.rows = pRes->numOfRows;
if (pRes->numOfRows != 0) { if (pRes->numOfRows != 0) {
doSetupSDataBlock(pRes, pBlock, pInput->pFilterInfo, pInput->numOfFilterCols); doSetupSDataBlock(pRes, pBlock, pInput->pFilterInfo, pInput->numOfFilterCols);
*newgroup = false; if (pBlock->info.rows > 0) {
return pBlock; *newgroup = false;
return pBlock;
}
} }
// No data block exists. So retrieve and transfer it into to SSDataBlock SSDataBlock* result = NULL;
TAOS_ROW pRow = NULL; do {
taos_fetch_block(pSql, &pRow); // No data block exists. So retrieve and transfer it into to SSDataBlock
TAOS_ROW pRow = NULL;
taos_fetch_block(pSql, &pRow);
if (pRes->numOfRows == 0) { if (pRes->numOfRows == 0) {
pOperator->status = OP_EXEC_DONE; pOperator->status = OP_EXEC_DONE;
return NULL; result = NULL;
} break;
}
pBlock->info.rows = pRes->numOfRows; pBlock->info.rows = pRes->numOfRows;
doSetupSDataBlock(pRes, pBlock, pInput->pFilterInfo, pInput->numOfFilterCols); doSetupSDataBlock(pRes, pBlock, pInput->pFilterInfo, pInput->numOfFilterCols);
*newgroup = false; *newgroup = false;
return pBlock; result = pBlock;
} while (result->info.rows == 0);
return result;
} }
static void fetchNextBlockIfCompleted(SOperatorInfo* pOperator, bool* newgroup) { static void fetchNextBlockIfCompleted(SOperatorInfo* pOperator, bool* newgroup) {
......
...@@ -5959,9 +5959,6 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) { ...@@ -5959,9 +5959,6 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) {
if (pBlock == NULL) { if (pBlock == NULL) {
break; break;
} }
if (pBlock->info.rows == 0) {
continue;
}
setTagValue(pOperator, pRuntimeEnv->current->pTable, pIntervalInfo->pCtx, pOperator->numOfOutput); setTagValue(pOperator, pRuntimeEnv->current->pTable, pIntervalInfo->pCtx, pOperator->numOfOutput);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册