fix(query): initialize output buffer for each output.
This commit is contained in:
parent
f5c1cb3b41
commit
67a291955e
|
@ -729,6 +729,7 @@ void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle);
|
|||
void setTbNameColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, const char* name);
|
||||
|
||||
void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset);
|
||||
void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput);
|
||||
|
||||
SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pResultRowInfo, char* pData,
|
||||
int16_t bytes, bool masterscan, uint64_t groupId, SExecTaskInfo* pTaskInfo,
|
||||
|
|
|
@ -213,6 +213,8 @@ static int32_t setSingleOutputTupleBufv1(SResultRowInfo* pResultRowInfo, STimeWi
|
|||
}
|
||||
|
||||
(*pResult)->win = *win;
|
||||
|
||||
clearResultRowInitFlag(pExprSup->pCtx, pExprSup->numOfExprs);
|
||||
setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -813,6 +813,20 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO
|
|||
}
|
||||
}
|
||||
|
||||
void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput) {
|
||||
for (int32_t i = 0; i < numOfOutput; ++i) {
|
||||
SResultRowEntryInfo* pResInfo = pCtx[i].resultInfo;
|
||||
if (pResInfo == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
pResInfo->initialized = false;
|
||||
pResInfo->numOfRes = 0;
|
||||
pResInfo->isNullRes = 0;
|
||||
pResInfo->complete = false;
|
||||
}
|
||||
}
|
||||
|
||||
void doFilter(SSDataBlock* pBlock, SFilterInfo* pFilterInfo, SColMatchInfo* pColMatchInfo) {
|
||||
if (pFilterInfo == NULL || pBlock->info.rows == 0) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue