From d626f62a3c3e8c7b595f2852b31284ebe3a84b3a Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 26 Apr 2022 14:25:40 +0800 Subject: [PATCH] fix: fix coredump if mode function with interval --- src/query/src/qExecutor.c | 4 ++-- src/query/src/qUtil.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 5e035463f8..140d0432a6 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -332,7 +332,7 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO tmp *= numOfRows; if (tmp >= 1024*1024*1024) { // 1G qError("size is too large, failed to allocate column buffer for output buffer"); - tmp = 128*1024*1024; + goto _clean; } int32_t size = (int32_t)MAX(tmp, minSize); idata.pData = calloc(1, size); // at least to hold a pointer on x64 platform @@ -2131,7 +2131,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf pRuntimeEnv->sasArray = calloc(pQueryAttr->numOfOutput, sizeof(SScalarExprSupport)); if (pRuntimeEnv->sasArray == NULL || pRuntimeEnv->pResultRowHashTable == NULL || pRuntimeEnv->keyBuf == NULL || - pRuntimeEnv->prevRow == NULL || pRuntimeEnv->tagVal == NULL) { + pRuntimeEnv->prevRow == NULL || pRuntimeEnv->tagVal == NULL || pRuntimeEnv->pool == NULL) { goto _clean; } diff --git a/src/query/src/qUtil.c b/src/query/src/qUtil.c index 67dfc130ed..a8582f2a33 100644 --- a/src/query/src/qUtil.c +++ b/src/query/src/qUtil.c @@ -206,7 +206,7 @@ SResultRowPool* initResultRowPool(size_t size) { tmp *= p->numOfElemPerBlock; if (tmp > 1024*1024*1024){ qError("ResultRow blockSize is too large:%" PRId64, tmp); - tmp = 128*1024*1024; + return NULL; } p->blockSize = (int32_t)tmp; p->position.pos = 0; -- GitLab