提交 f5827bd9 编写于 作者: wmmhello's avatar wmmhello

fix: fix coredump if mode function with interval

上级 82aff4ea
...@@ -330,8 +330,8 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO ...@@ -330,8 +330,8 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO
int64_t tmp = idata.info.bytes; int64_t tmp = idata.info.bytes;
tmp *= numOfRows; tmp *= numOfRows;
if (tmp >= 1024*1024*1024) { // 1G if (tmp >= INT32_MAX) {
qError("size is too large, failed to allocate column buffer for output buffer"); qError("size is too large, failed to allocate column buffer for output buffer:%" PRId64, tmp);
tmp = 128*1024*1024; tmp = 128*1024*1024;
} }
size_t size = (size_t)MAX(tmp, minSize); size_t size = (size_t)MAX(tmp, minSize);
...@@ -9556,7 +9556,7 @@ void setResultBufSize(SQueryAttr* pQueryAttr, SRspResultInfo* pResultInfo) { ...@@ -9556,7 +9556,7 @@ void setResultBufSize(SQueryAttr* pQueryAttr, SRspResultInfo* pResultInfo) {
// the minimum number of rows for projection query // the minimum number of rows for projection query
const int32_t MIN_ROWS_FOR_PRJ_QUERY = 8192; 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; const float THRESHOLD_RATIO = 0.85f;
......
...@@ -204,7 +204,7 @@ SResultRowPool* initResultRowPool(size_t size) { ...@@ -204,7 +204,7 @@ SResultRowPool* initResultRowPool(size_t size) {
p->elemSize = (int32_t) size; p->elemSize = (int32_t) size;
int64_t tmp = p->elemSize; int64_t tmp = p->elemSize;
tmp *= p->numOfElemPerBlock; tmp *= p->numOfElemPerBlock;
if (tmp > 1024*1024*1024){ if (tmp > INT32_MAX){
qError("ResultRow blockSize is too large:%" PRId64, tmp); qError("ResultRow blockSize is too large:%" PRId64, tmp);
return NULL; return NULL;
} }
...@@ -223,6 +223,7 @@ SResultRow* getNewResultRow(SResultRowPool* p) { ...@@ -223,6 +223,7 @@ SResultRow* getNewResultRow(SResultRowPool* p) {
void* ptr = NULL; void* ptr = NULL;
if (p->position.pos == 0) { if (p->position.pos == 0) {
ptr = calloc(1, p->blockSize); ptr = calloc(1, p->blockSize);
if(ptr == NULL) return NULL;
taosArrayPush(p->pData, &ptr); taosArrayPush(p->pData, &ptr);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册