diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 6531d4f7ac352bd56857fea0dce53cde37ced917..1facab0b34e271394c37486ee2b900ec89c8f71c 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -330,8 +330,8 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO int64_t tmp = idata.info.bytes; tmp *= numOfRows; - if (tmp >= 1024*1024*1024) { // 1G - qError("size is too large, failed to allocate column buffer for output buffer"); + if (tmp >= INT32_MAX) { + qError("size is too large, failed to allocate column buffer for output buffer:%" PRId64, tmp); tmp = 128*1024*1024; } size_t size = (size_t)MAX(tmp, minSize); @@ -9556,7 +9556,7 @@ void setResultBufSize(SQueryAttr* pQueryAttr, SRspResultInfo* pResultInfo) { // the minimum number of rows for projection query const int32_t MIN_ROWS_FOR_PRJ_QUERY = 8192; - const int32_t DEFAULT_MIN_ROWS = 1024; + const int32_t DEFAULT_MIN_ROWS = 4096; const float THRESHOLD_RATIO = 0.85f; diff --git a/src/query/src/qUtil.c b/src/query/src/qUtil.c index a8582f2a33dac0740b4a741c98dcd035621a2837..1628c2d5111268111ca88cbe511095e8334453ed 100644 --- a/src/query/src/qUtil.c +++ b/src/query/src/qUtil.c @@ -204,7 +204,7 @@ SResultRowPool* initResultRowPool(size_t size) { p->elemSize = (int32_t) size; int64_t tmp = p->elemSize; tmp *= p->numOfElemPerBlock; - if (tmp > 1024*1024*1024){ + if (tmp > INT32_MAX){ qError("ResultRow blockSize is too large:%" PRId64, tmp); return NULL; } @@ -223,6 +223,7 @@ SResultRow* getNewResultRow(SResultRowPool* p) { void* ptr = NULL; if (p->position.pos == 0) { ptr = calloc(1, p->blockSize); + if(ptr == NULL) return NULL; taosArrayPush(p->pData, &ptr); } else {