fix(query): prepare the buffer before assigning result.

This commit is contained in:
Haojun Liao 2022-06-22 20:24:26 +08:00
parent 72a942b09e
commit 324eecdd99
2 changed files with 5 additions and 2 deletions

View File

@ -299,7 +299,9 @@ int32_t colDataAssign(SColumnInfoData* pColumnInfoData, const SColumnInfoData* p
return numOfRows;
}
if (pBlockInfo != NULL) {
ASSERT(pBlockInfo->capacity >= numOfRows);
}
if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) {
memcpy(pColumnInfoData->varmeta.offset, pSource->varmeta.offset, sizeof(int32_t) * numOfRows);

View File

@ -983,6 +983,7 @@ int32_t scalarCalculate(SNode *pNode, SArray *pBlockList, SScalarParam *pDst) {
SCL_ERR_JRET(TSDB_CODE_QRY_APP_ERROR);
}
colInfoDataEnsureCapacity(pDst->columnData, res->numOfRows);
colDataAssign(pDst->columnData, res->columnData, res->numOfRows, NULL);
pDst->numOfRows = res->numOfRows;
taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES);