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

fix: fix coredump if mode function with interval

上级 93daebb9
......@@ -3362,13 +3362,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
tVariantDump(pVariant, val, TSDB_DATA_TYPE_BIGINT, true);
if(functionId == TSDB_FUNC_UNIQUE){ // consider of memory size
if(pSchema->bytes < 10){
GET_INT64_VAL(val) = MAX_UNIQUE_RESULT_ROWS * 100;
}else if(pSchema->bytes < 100){
GET_INT64_VAL(val) = MAX_UNIQUE_RESULT_ROWS * 10;
}else{
GET_INT64_VAL(val) = MAX_UNIQUE_RESULT_ROWS;
}
GET_INT64_VAL(val) = MAX_UNIQUE_RESULT_ROWS;
}
int64_t numRowsSelected = GET_INT64_VAL(val);
......
......@@ -78,10 +78,10 @@ typedef struct SDiskbasedResultBuf {
#define DEFAULT_INTERN_BUF_PAGE_SIZE (1024L) // in bytes
#define PAGE_INFO_INITIALIZER (SPageDiskInfo){-1, -1}
#define MAX_UNIQUE_RESULT_ROWS (10000)
#define MAX_UNIQUE_RESULT_SIZE (1024*1024*10)
#define MAX_MODE_INNER_RESULT_ROWS (1000000)
#define MAX_MODE_INNER_RESULT_SIZE (1024*1024*10)
#define MAX_UNIQUE_RESULT_ROWS (100000)
#define MAX_UNIQUE_RESULT_SIZE (1024*1024)
#define MAX_MODE_INNER_RESULT_ROWS (100000)
#define MAX_MODE_INNER_RESULT_SIZE (1024*1024)
/**
* create disk-based result buffer
* @param pResultBuf
......
......@@ -334,7 +334,7 @@ SSDataBlock* createOutputBuf(SExprInfo* pExpr, int32_t numOfOutput, int32_t numO
qError("size is too large, failed to allocate column buffer for output buffer");
goto _clean;
}
int32_t size = (int32_t)MAX(tmp, minSize);
size_t size = (size_t)MAX(tmp, minSize);
idata.pData = calloc(1, size); // at least to hold a pointer on x64 platform
if (idata.pData == NULL) {
qError("failed to allocate column buffer for output buffer");
......@@ -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 = 4096;
const int32_t DEFAULT_MIN_ROWS = 1024;
const float THRESHOLD_RATIO = 0.85f;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册