[td-2895] fix bug found in regression test.

This commit is contained in:
Haojun Liao 2021-03-11 22:58:10 +08:00
parent 2891d51a3b
commit 706b441e70
1 changed files with 4 additions and 1 deletions

View File

@ -202,6 +202,8 @@ static void doSetTableGroupOutputBuf(SQueryRuntimeEnv* pRuntimeEnv, SResultRowIn
// setup the output buffer for each operator
static SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numOfRows) {
const static int32_t minSize = 8;
SSDataBlock *res = calloc(1, sizeof(SSDataBlock));
res->info.numOfCols = numOfOutput;
@ -211,7 +213,8 @@ static SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32
idata.info.type = pExpr[i].type;
idata.info.bytes = pExpr[i].bytes;
idata.info.colId = pExpr[i].base.resColId;
idata.pData = calloc(numOfRows, idata.info.bytes);
idata.pData = calloc(1, MAX(idata.info.bytes * numOfRows, minSize)); // at least to hold a pointer on x64 platform
taosArrayPush(res->pDataBlock, &idata);
}