enh:[TD-31063] use properer errcode.
This commit is contained in:
parent
70699ba61e
commit
dc23446d6b
|
@ -3566,7 +3566,7 @@ int32_t diffFunctionByRow(SArray* pCtxArray) {
|
||||||
|
|
||||||
SArray* pRows = taosArrayInit_s(sizeof(SFuncInputRow), diffColNum);
|
SArray* pRows = taosArrayInit_s(sizeof(SFuncInputRow), diffColNum);
|
||||||
if (NULL == pRows) {
|
if (NULL == pRows) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool keepNull = false;
|
bool keepNull = false;
|
||||||
|
@ -5958,7 +5958,7 @@ int32_t modeFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
|
||||||
} else {
|
} else {
|
||||||
pInfo->pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
pInfo->pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||||
if (NULL == pInfo->pHash) {
|
if (NULL == pInfo->pHash) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pInfo->nullTupleSaved = false;
|
pInfo->nullTupleSaved = false;
|
||||||
|
|
|
@ -35,14 +35,14 @@ static void doInitFunctionTable() {
|
||||||
gFunMgtService.pFuncNameHashTable =
|
gFunMgtService.pFuncNameHashTable =
|
||||||
taosHashInit(funcMgtBuiltinsNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
taosHashInit(funcMgtBuiltinsNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||||
if (NULL == gFunMgtService.pFuncNameHashTable) {
|
if (NULL == gFunMgtService.pFuncNameHashTable) {
|
||||||
initFunctionCode = TSDB_CODE_FAILED;
|
initFunctionCode = terrno;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < funcMgtBuiltinsNum; ++i) {
|
for (int32_t i = 0; i < funcMgtBuiltinsNum; ++i) {
|
||||||
if (TSDB_CODE_SUCCESS != taosHashPut(gFunMgtService.pFuncNameHashTable, funcMgtBuiltins[i].name,
|
if (TSDB_CODE_SUCCESS != taosHashPut(gFunMgtService.pFuncNameHashTable, funcMgtBuiltins[i].name,
|
||||||
strlen(funcMgtBuiltins[i].name), &i, sizeof(int32_t))) {
|
strlen(funcMgtBuiltins[i].name), &i, sizeof(int32_t))) {
|
||||||
initFunctionCode = TSDB_CODE_FAILED;
|
initFunctionCode = terrno;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,7 +273,7 @@ int32_t tMemBucketCreate(int32_t nElemSize, int16_t dataType, double minval, dou
|
||||||
(*pBucket)->groupPagesMap = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
|
(*pBucket)->groupPagesMap = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
|
||||||
if ((*pBucket)->groupPagesMap == NULL) {
|
if ((*pBucket)->groupPagesMap == NULL) {
|
||||||
tMemBucketDestroy(*pBucket);
|
tMemBucketDestroy(*pBucket);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
if (setBoundingBox(&(*pBucket)->range, (*pBucket)->type, minval, maxval) != 0) {
|
if (setBoundingBox(&(*pBucket)->range, (*pBucket)->type, minval, maxval) != 0) {
|
||||||
// qError("MemBucket:%p, invalid value range: %f-%f", pBucket, minval, maxval);
|
// qError("MemBucket:%p, invalid value range: %f-%f", pBucket, minval, maxval);
|
||||||
|
@ -409,7 +409,7 @@ int32_t tMemBucketPut(tMemBucket *pBucket, const void *data, size_t size) {
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
pPageIdList = taosArrayInit(4, sizeof(int32_t));
|
pPageIdList = taosArrayInit(4, sizeof(int32_t));
|
||||||
if (NULL == pPageIdList) {
|
if (NULL == pPageIdList) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
int32_t code = taosHashPut(pBucket->groupPagesMap, &groupId, sizeof(groupId), &pPageIdList, POINTER_BYTES);
|
int32_t code = taosHashPut(pBucket->groupPagesMap, &groupId, sizeof(groupId), &pPageIdList, POINTER_BYTES);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
|
|
Loading…
Reference in New Issue