enh:modify error code passing
This commit is contained in:
parent
651a94d747
commit
df147c60b0
|
@ -424,7 +424,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, voi
|
|||
|
||||
keyHash = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, false);
|
||||
if (!keyHash) {
|
||||
retCode = TSDB_CODE_OUT_OF_MEMORY;
|
||||
retCode = terrno;
|
||||
goto end;
|
||||
}
|
||||
for (int32_t i = 0; i < size; i++) {
|
||||
|
@ -494,7 +494,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, voi
|
|||
goto end;
|
||||
}
|
||||
if (NULL == taosArrayPush(pTagVals, &val)) {
|
||||
retCode = TSDB_CODE_OUT_OF_MEMORY;
|
||||
retCode = terrno;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
@ -641,7 +641,7 @@ static int32_t buildTableReq(SHashObj* pTablesHash, SArray** pTables) {
|
|||
if (NULL != pTablesHash) {
|
||||
*pTables = taosArrayInit(taosHashGetSize(pTablesHash), sizeof(SName));
|
||||
if (NULL == *pTables) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
void* p = taosHashIterate(pTablesHash, NULL);
|
||||
while (NULL != p) {
|
||||
|
@ -653,7 +653,7 @@ static int32_t buildTableReq(SHashObj* pTablesHash, SArray** pTables) {
|
|||
int32_t code = tNameFromString(&name, fullName, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
if (NULL == taosArrayPush(*pTables, &name)) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
|
@ -672,7 +672,7 @@ static int32_t buildDbReq(SHashObj* pDbsHash, SArray** pDbs) {
|
|||
if (NULL != pDbsHash) {
|
||||
*pDbs = taosArrayInit(taosHashGetSize(pDbsHash), TSDB_DB_FNAME_LEN);
|
||||
if (NULL == *pDbs) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
void* p = taosHashIterate(pDbsHash, NULL);
|
||||
while (NULL != p) {
|
||||
|
@ -684,7 +684,7 @@ static int32_t buildDbReq(SHashObj* pDbsHash, SArray** pDbs) {
|
|||
taosHashCancelIterate(pDbsHash, p);
|
||||
taosArrayDestroy(*pDbs);
|
||||
*pDbs = NULL;
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
p = taosHashIterate(pDbsHash, p);
|
||||
}
|
||||
|
@ -697,7 +697,7 @@ static int32_t buildTableReqFromDb(SHashObj* pDbsHash, SArray** pDbs) {
|
|||
if (NULL == *pDbs) {
|
||||
*pDbs = taosArrayInit(taosHashGetSize(pDbsHash), sizeof(STablesReq));
|
||||
if (NULL == *pDbs) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
SParseTablesMetaReq* p = taosHashIterate(pDbsHash, NULL);
|
||||
|
@ -707,7 +707,7 @@ static int32_t buildTableReqFromDb(SHashObj* pDbsHash, SArray** pDbs) {
|
|||
int32_t code = buildTableReq(p->pTables, &req.pTables);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
if (NULL == taosArrayPush(*pDbs, &req)) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
|
@ -726,7 +726,7 @@ static int32_t buildUserAuthReq(SHashObj* pUserAuthHash, SArray** pUserAuth) {
|
|||
if (NULL != pUserAuthHash) {
|
||||
*pUserAuth = taosArrayInit(taosHashGetSize(pUserAuthHash), sizeof(SUserAuthInfo));
|
||||
if (NULL == *pUserAuth) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
void* p = taosHashIterate(pUserAuthHash, NULL);
|
||||
while (NULL != p) {
|
||||
|
@ -740,7 +740,7 @@ static int32_t buildUserAuthReq(SHashObj* pUserAuthHash, SArray** pUserAuth) {
|
|||
taosHashCancelIterate(pUserAuthHash, p);
|
||||
taosArrayDestroy(*pUserAuth);
|
||||
*pUserAuth = NULL;
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
p = taosHashIterate(pUserAuthHash, p);
|
||||
}
|
||||
|
@ -752,7 +752,7 @@ static int32_t buildUdfReq(SHashObj* pUdfHash, SArray** pUdf) {
|
|||
if (NULL != pUdfHash) {
|
||||
*pUdf = taosArrayInit(taosHashGetSize(pUdfHash), TSDB_FUNC_NAME_LEN);
|
||||
if (NULL == *pUdf) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
void* p = taosHashIterate(pUdfHash, NULL);
|
||||
while (NULL != p) {
|
||||
|
@ -764,7 +764,7 @@ static int32_t buildUdfReq(SHashObj* pUdfHash, SArray** pUdf) {
|
|||
taosHashCancelIterate(pUdfHash, p);
|
||||
taosArrayDestroy(*pUdf);
|
||||
*pUdf = NULL;
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
p = taosHashIterate(pUdfHash, p);
|
||||
}
|
||||
|
@ -837,7 +837,7 @@ static int32_t putMetaDataToHash(const char* pKey, int32_t len, const SArray* pD
|
|||
if (NULL == *pHash) {
|
||||
*pHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == *pHash) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
SMetaRes* pRes = taosArrayGet(pData, index);
|
||||
|
@ -973,7 +973,7 @@ static int32_t reserveTableReqInCacheImpl(const char* pTbFName, int32_t len, SHa
|
|||
if (NULL == *pTables) {
|
||||
*pTables = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == *pTables) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
return taosHashPut(*pTables, pTbFName, len, &nullPointer, POINTER_BYTES);
|
||||
|
@ -999,7 +999,7 @@ static int32_t reserveTableReqInDbCache(int32_t acctId, const char* pDb, const c
|
|||
if (NULL == *pDbs) {
|
||||
*pDbs = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == *pDbs) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
char fullName[TSDB_DB_FNAME_LEN];
|
||||
|
@ -1074,7 +1074,7 @@ static int32_t reserveDbReqInCache(int32_t acctId, const char* pDb, SHashObj** p
|
|||
if (NULL == *pDbs) {
|
||||
*pDbs = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == *pDbs) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
char fullName[TSDB_TABLE_FNAME_LEN];
|
||||
|
@ -1155,7 +1155,7 @@ static int32_t reserveUserAuthInCacheImpl(const char* pKey, int32_t len, SParseM
|
|||
if (NULL == pMetaCache->pUserAuth) {
|
||||
pMetaCache->pUserAuth = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == pMetaCache->pUserAuth) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
return taosHashPut(pMetaCache->pUserAuth, pKey, len, &nullPointer, POINTER_BYTES);
|
||||
|
@ -1191,7 +1191,7 @@ int32_t reserveUdfInCache(const char* pFunc, SParseMetaCache* pMetaCache) {
|
|||
if (NULL == pMetaCache->pUdf) {
|
||||
pMetaCache->pUdf = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||
if (NULL == pMetaCache->pUdf) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
return taosHashPut(pMetaCache->pUdf, pFunc, strlen(pFunc), &nullPointer, POINTER_BYTES);
|
||||
|
|
|
@ -1198,7 +1198,7 @@ static int32_t pdcJoinCollectColsFromParent(SJoinLogicNode* pJoin, SSHashObj* pT
|
|||
.pColHash = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK)
|
||||
};
|
||||
if (NULL == cxt.pColHash) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
nodesWalkExpr(pJoin->pPrimKeyEqCond, pdcJoinCollectCondCol, &cxt);
|
||||
|
@ -4304,7 +4304,7 @@ static int32_t lastRowScanBuildFuncTypes(SScanLogicNode* pScan, SColumnNode* pCo
|
|||
pScan->pFuncTypes = taosArrayInit(pScan->pScanCols->length, sizeof(SFunctParam));
|
||||
if (NULL == pScan->pFuncTypes) {
|
||||
taosMemoryFree(pFuncTypeParam);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4317,7 +4317,7 @@ static int32_t lastRowScanBuildFuncTypes(SScanLogicNode* pScan, SColumnNode* pCo
|
|||
strcpy(pFuncTypeParam->pCol->name, pColNode->colName);
|
||||
if (NULL == taosArrayPush(pScan->pFuncTypes, pFuncTypeParam)) {
|
||||
taosMemoryFree(pFuncTypeParam);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
taosMemoryFree(pFuncTypeParam);
|
||||
|
@ -6692,7 +6692,7 @@ static int32_t fillTSMAOptCtx(STSMAOptCtx* pTsmaOptCtx, SScanLogicNode* pScan) {
|
|||
pTsmaOptCtx->pUsefulTsmas = taosArrayInit(pScan->pTsmas->size, sizeof(STSMAOptUsefulTsma));
|
||||
pTsmaOptCtx->pUsedTsmas = taosArrayInit(3, sizeof(STSMAOptUsefulTsma));
|
||||
if (!pTsmaOptCtx->pUsefulTsmas || !pTsmaOptCtx->pUsedTsmas) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
@ -6755,7 +6755,7 @@ static int32_t tsmaOptCheckValidFuncs(const SArray* pTsmaFuncs, const SNodeList*
|
|||
}
|
||||
found = true;
|
||||
if (NULL == taosArrayPush(pTsmaScanCols, &i)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -6813,7 +6813,7 @@ static int32_t tsmaOptFilterTsmas(STSMAOptCtx* pTsmaOptCtx) {
|
|||
for (int32_t i = 0; i < pTsmaOptCtx->pTsmas->size; ++i) {
|
||||
if (!pTsmaScanCols) {
|
||||
pTsmaScanCols = taosArrayInit(pTsmaOptCtx->pAggFuncs->length, sizeof(int32_t));
|
||||
if (!pTsmaScanCols) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pTsmaScanCols) return terrno;
|
||||
}
|
||||
if (pTsmaOptCtx->pScan->tableType == TSDB_CHILD_TABLE || pTsmaOptCtx->pScan->tableType == TSDB_NORMAL_TABLE) {
|
||||
const STsmaTargetTbInfo* ptbInfo = taosArrayGet(pTsmaOptCtx->pScan->pTsmaTargetTbInfo, i);
|
||||
|
@ -6842,7 +6842,7 @@ static int32_t tsmaOptFilterTsmas(STSMAOptCtx* pTsmaOptCtx) {
|
|||
if (pTsmaScanCols) {
|
||||
taosArrayDestroy(pTsmaScanCols);
|
||||
}
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
if (pTsmaScanCols) taosArrayDestroy(pTsmaScanCols);
|
||||
|
@ -6949,7 +6949,7 @@ static int32_t tsmaOptSplitWindows(STSMAOptCtx* pTsmaOptCtx, const STimeWindow*
|
|||
.scanRange = scanRange,
|
||||
.pTsmaScanCols = pTsmaFound ? pTsmaFound->pTsmaScanCols : NULL};
|
||||
if (NULL == taosArrayPush(pTsmaOptCtx->pUsedTsmas, &usefulTsma))
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
// the main tsma
|
||||
|
@ -6962,7 +6962,7 @@ static int32_t tsmaOptSplitWindows(STSMAOptCtx* pTsmaOptCtx, const STimeWindow*
|
|||
STSMAOptUsefulTsma usefulTsma = {
|
||||
.pTsma = pTsma, .scanRange = scanRange, .pTsmaScanCols = pUsefulTsma->pTsmaScanCols};
|
||||
if (NULL == taosArrayPush(pTsmaOptCtx->pUsedTsmas, &usefulTsma))
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
// add tail tsma if possible
|
||||
|
@ -6976,7 +6976,7 @@ static int32_t tsmaOptSplitWindows(STSMAOptCtx* pTsmaOptCtx, const STimeWindow*
|
|||
.scanRange = scanRange,
|
||||
.pTsmaScanCols = pTsmaFound ? pTsmaFound->pTsmaScanCols : NULL};
|
||||
if (NULL == taosArrayPush(pTsmaOptCtx->pUsedTsmas, &usefulTsma))
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -171,18 +171,18 @@ static int32_t putSlotToHashImpl(int16_t dataBlockId, int16_t slotId, const char
|
|||
if (NULL != pIndex) {
|
||||
SSlotIdInfo info = {.slotId = slotId, .set = false};
|
||||
if (NULL == taosArrayPush(pIndex->pSlotIdsInfo, &info)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
SSlotIndex index = {.dataBlockId = dataBlockId, .pSlotIdsInfo = taosArrayInit(TARRAY_MIN_SIZE, sizeof(SSlotIdInfo))};
|
||||
if (NULL == index.pSlotIdsInfo) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
SSlotIdInfo info = {.slotId = slotId, .set = false};
|
||||
if (NULL == taosArrayPush(index.pSlotIdsInfo, &info)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
return taosHashPut(pHash, pName, len, &index, sizeof(SSlotIndex));
|
||||
}
|
||||
|
@ -195,22 +195,22 @@ static int32_t createDataBlockDescHash(SPhysiPlanContext* pCxt, int32_t capacity
|
|||
SHashObj** pDescHash, SHashObj** ppProjIdxDescHash) {
|
||||
SHashObj* pHash = taosHashInit(capacity, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK);
|
||||
if (NULL == pHash) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
SHashObj* pProjIdxHash = taosHashInit(capacity, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK);
|
||||
if (!pProjIdxHash) {
|
||||
taosHashCleanup(pHash);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
if (NULL == taosArrayInsert(pCxt->pLocationHelper, dataBlockId, &pHash)) {
|
||||
taosHashCleanup(pHash);
|
||||
taosHashCleanup(pProjIdxHash);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
if (NULL == taosArrayInsert(pCxt->pProjIdxLocHelper, dataBlockId, &pProjIdxHash)) {
|
||||
taosHashCleanup(pHash);
|
||||
taosHashCleanup(pProjIdxHash);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
*pDescHash = pHash;
|
||||
|
@ -529,14 +529,14 @@ static int32_t colIdCompare(const void* pLeft, const void* pRight) {
|
|||
static int32_t sortScanCols(SNodeList* pScanCols) {
|
||||
SArray* pArray = taosArrayInit(LIST_LENGTH(pScanCols), POINTER_BYTES);
|
||||
if (NULL == pArray) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t code = 0;
|
||||
SNode* pCol = NULL;
|
||||
FOREACH(pCol, pScanCols) {
|
||||
if (NULL == taosArrayPush(pArray, &pCol)) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -708,7 +708,7 @@ static int32_t createLastRowScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSu
|
|||
if (TSDB_CODE_SUCCESS == code && pScanLogicNode->pFuncTypes != NULL) {
|
||||
pScan->pFuncTypes = taosArrayInit(taosArrayGetSize(pScanLogicNode->pFuncTypes), sizeof(int32_t));
|
||||
if (NULL == pScan->pFuncTypes) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SNode* pTargetNode = NULL;
|
||||
|
@ -724,7 +724,7 @@ static int32_t createLastRowScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSu
|
|||
if (pColNode->colId == pFunctParam->pCol->colId &&
|
||||
0 == strncmp(pColNode->colName, pFunctParam->pCol->name, strlen(pColNode->colName))) {
|
||||
if (NULL == taosArrayInsert(pScan->pFuncTypes, funcTypeIndex, &pFunctParam->type)) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -3047,7 +3047,7 @@ static int32_t setExecNodeList(SPhysiPlanContext* pCxt, SArray* pExecNodeList) {
|
|||
if (pCxt->hasSysScan || !pCxt->hasScan) {
|
||||
SQueryNodeLoad node = {.addr = {.nodeId = MNODE_HANDLE, .epSet = pCxt->pPlanCxt->mgmtEpSet}, .load = 0};
|
||||
if (NULL == taosArrayPush(pExecNodeList, &node))
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
@ -3063,7 +3063,7 @@ int32_t createPhysiPlan(SPlanContext* pCxt, SQueryLogicPlan* pLogicPlan, SQueryP
|
|||
if (NULL == cxt.pLocationHelper || !cxt.pProjIdxLocHelper) {
|
||||
taosArrayDestroy(cxt.pLocationHelper);
|
||||
taosArrayDestroy(cxt.pProjIdxLocHelper);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t code = doCreatePhysiPlan(&cxt, pLogicPlan, pPlan);
|
||||
|
|
|
@ -210,7 +210,6 @@ int32_t asyncSendMsgToServerExt(void* pTransporter, SEpSet* epSet, int64_t* pTra
|
|||
if (NULL == pMsg) {
|
||||
qError("0x%" PRIx64 " msg:%s malloc failed", pInfo->requestId, TMSG_INFO(pInfo->msgType));
|
||||
destroySendMsgInfo(pInfo);
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -541,7 +540,7 @@ int32_t cloneTableMeta(STableMeta* pSrc, STableMeta** pDst) {
|
|||
}
|
||||
*pDst = taosMemoryMalloc(metaSize + schemaExtSize);
|
||||
if (NULL == *pDst) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
memcpy(*pDst, pSrc, metaSize);
|
||||
if (useCompress(pSrc->tableType) && pSrc->schemaExt) {
|
||||
|
@ -585,7 +584,7 @@ int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst) {
|
|||
|
||||
*pDst = taosMemoryMalloc(sizeof(*pSrc));
|
||||
if (NULL == *pDst) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
memcpy(*pDst, pSrc, sizeof(*pSrc));
|
||||
(*pDst)->vgArray = NULL;
|
||||
|
@ -595,7 +594,7 @@ int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst) {
|
|||
HASH_ENTRY_LOCK);
|
||||
if (NULL == (*pDst)->vgHash) {
|
||||
taosMemoryFreeClear(*pDst);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SVgroupInfo* vgInfo = NULL;
|
||||
|
|
|
@ -53,7 +53,7 @@ int32_t queryBuildUseDbOutput(SUseDbOutput *pOut, SUseDbRsp *usedbRsp) {
|
|||
pOut->dbVgroup->vgHash =
|
||||
taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
|
||||
if (NULL == pOut->dbVgroup->vgHash) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < usedbRsp->vgNum; ++i) {
|
||||
|
@ -259,11 +259,11 @@ int32_t queryBuildRetrieveFuncMsg(void *input, char **msg, int32_t msgSize, int3
|
|||
funcReq.ignoreCodeComment = true;
|
||||
funcReq.pFuncNames = taosArrayInit(1, strlen(input) + 1);
|
||||
if (NULL == funcReq.pFuncNames) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
if (taosArrayPush(funcReq.pFuncNames, input) == NULL) {
|
||||
taosArrayDestroy(funcReq.pFuncNames);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t bufLen = tSerializeSRetrieveFuncReq(NULL, 0, &funcReq);
|
||||
|
|
|
@ -17,7 +17,7 @@ int32_t qwMallocFetchRsp(int8_t rpcMalloc, int32_t length, SRetrieveTableRsp **r
|
|||
(SRetrieveTableRsp *)(rpcMalloc ? rpcReallocCont(*rsp, msgSize) : taosMemoryRealloc(*rsp, msgSize));
|
||||
if (NULL == pRsp) {
|
||||
qError("rpcMallocCont %d failed", msgSize);
|
||||
QW_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_RET(terrno);
|
||||
}
|
||||
|
||||
if (NULL == *rsp) {
|
||||
|
@ -79,7 +79,7 @@ int32_t qwBuildAndSendQueryRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t c
|
|||
void *pRsp = rpcMallocCont(msgSize);
|
||||
if (NULL == pRsp) {
|
||||
qError("rpcMallocCont %d failed", msgSize);
|
||||
QW_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_RET(terrno);
|
||||
}
|
||||
|
||||
if (tSerializeSQueryTableRsp(pRsp, msgSize, &rsp) < 0) {
|
||||
|
@ -246,7 +246,7 @@ int32_t qwBuildAndSendDropMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
|
|||
void *msg = rpcMallocCont(msgSize);
|
||||
if (NULL == msg) {
|
||||
QW_SCH_TASK_ELOG("rpcMallocCont %d failed", msgSize);
|
||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
if (tSerializeSTaskDropReq(msg, msgSize, &qMsg) < 0) {
|
||||
|
@ -325,7 +325,7 @@ int32_t qwRegisterQueryBrokenLinkArg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
|
|||
void *msg = rpcMallocCont(msgSize);
|
||||
if (NULL == msg) {
|
||||
QW_SCH_TASK_ELOG("rpcMallocCont %d failed", msgSize);
|
||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
if (tSerializeSTaskDropReq(msg, msgSize, &qMsg) < 0) {
|
||||
|
@ -360,7 +360,7 @@ int32_t qwRegisterHbBrokenLinkArg(SQWorker *mgmt, uint64_t sId, SRpcHandleInfo *
|
|||
void *msg = rpcMallocCont(msgSize);
|
||||
if (NULL == msg) {
|
||||
QW_SCH_ELOG("calloc %d failed", msgSize);
|
||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_ERR_RET(terrno);
|
||||
}
|
||||
if (tSerializeSSchedulerHbReq(msg, msgSize, &req) < 0) {
|
||||
QW_SCH_ELOG("tSerializeSSchedulerHbReq hbReq failed, size:%d", msgSize);
|
||||
|
|
|
@ -78,7 +78,7 @@ int32_t qwAddSchedulerImpl(SQWorker *mgmt, uint64_t sId, int32_t rwType) {
|
|||
|
||||
if (NULL == newSch.tasksHash) {
|
||||
QW_SCH_ELOG("taosHashInit %d failed", mgmt->cfg.maxSchTaskNum);
|
||||
QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
QW_LOCK(QW_WRITE, &mgmt->schLock);
|
||||
|
|
|
@ -273,7 +273,7 @@ int32_t qwGenerateSchHbRsp(SQWorker *mgmt, SQWSchStatus *sch, SQWHbInfo *hbInfo)
|
|||
if (NULL == hbInfo->rsp.taskStatus) {
|
||||
QW_UNLOCK(QW_READ, &sch->tasksLock);
|
||||
QW_ELOG("taosArrayInit taskStatus failed, num:%d", taskNum);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
void *key = NULL;
|
||||
|
@ -1343,14 +1343,14 @@ int32_t qWorkerInit(int8_t nodeType, int32_t nodeId, void **qWorkerMgmt, const S
|
|||
if (NULL == mgmt->schHash) {
|
||||
taosMemoryFreeClear(mgmt);
|
||||
qError("init %d scheduler hash failed", mgmt->cfg.maxSchedulerNum);
|
||||
QW_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
mgmt->ctxHash =
|
||||
taosHashInit(mgmt->cfg.maxTaskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
|
||||
if (NULL == mgmt->ctxHash) {
|
||||
qError("init %d task ctx hash failed", mgmt->cfg.maxTaskNum);
|
||||
QW_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
QW_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
mgmt->timer = taosTmrInit(0, 0, 0, "qworker");
|
||||
|
|
|
@ -970,7 +970,7 @@ int32_t filterDetachCnfGroup(SFilterGroup *gp1, SFilterGroup *gp2, SArray *group
|
|||
|
||||
if (NULL == taosArrayPush(group, &gp)) {
|
||||
taosMemoryFreeClear(gp.unitIdxs);
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -989,7 +989,7 @@ int32_t filterDetachCnfGroups(SArray *group, SArray *left, SArray *right) {
|
|||
SFilterGroup *gp = NULL;
|
||||
while ((gp = (SFilterGroup *)taosArrayPop(right)) != NULL) {
|
||||
if (NULL == taosArrayPush(group, gp)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ int32_t filterDetachCnfGroups(SArray *group, SArray *left, SArray *right) {
|
|||
SFilterGroup *gp = NULL;
|
||||
while ((gp = (SFilterGroup *)taosArrayPop(left)) != NULL) {
|
||||
if (NULL == taosArrayPush(group, gp)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1177,7 +1177,7 @@ int32_t filterAddUnitImpl(SFilterInfo *info, uint8_t optr, SFilterFieldId *left,
|
|||
taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, false);
|
||||
if (NULL == info->pctx.unitHash) {
|
||||
fltError("taosHashInit failed, size:%d", FILTER_DEFAULT_GROUP_SIZE * FILTER_DEFAULT_UNIT_SIZE);
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
} else {
|
||||
char v[14] = {0};
|
||||
|
@ -1196,7 +1196,7 @@ int32_t filterAddUnitImpl(SFilterInfo *info, uint8_t optr, SFilterFieldId *left,
|
|||
|
||||
void *tmp = taosMemoryRealloc(info->units, info->unitSize * sizeof(SFilterUnit));
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
info->units = (SFilterUnit *)tmp;
|
||||
(void)memset(info->units + psize, 0, sizeof(*info->units) * FILTER_DEFAULT_UNIT_SIZE);
|
||||
|
@ -1264,7 +1264,7 @@ int32_t filterAddUnitToGroup(SFilterGroup *group, uint32_t unitIdx) {
|
|||
|
||||
void *tmp = taosMemoryRealloc(group->unitIdxs, group->unitSize * sizeof(*group->unitIdxs));
|
||||
if (tmp == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
group->unitIdxs = tmp;
|
||||
}
|
||||
|
@ -1351,7 +1351,7 @@ int32_t fltAddGroupUnitFromNode(SFilterInfo *info, SNode *tree, SArray *group) {
|
|||
}
|
||||
if (NULL == taosArrayPush(group, &fgroup)) {
|
||||
filterFreeGroup((void*)&fgroup);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1368,7 +1368,7 @@ int32_t fltAddGroupUnitFromNode(SFilterInfo *info, SNode *tree, SArray *group) {
|
|||
FLT_ERR_RET(filterAddUnitToGroup(&fgroup, uidx));
|
||||
|
||||
if (NULL == taosArrayPush(group, &fgroup)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1479,7 +1479,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
if (func(&ra->s, &ra->e) == 0) {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &ra->s);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1489,13 +1489,13 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
} else {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &ra->s);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
void *data2 = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data2 == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data2, &ra->e);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data2, FLD_TYPE_VALUE, &right2, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1512,7 +1512,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
if (!FILTER_GET_FLAG(ra->sflag, RANGE_FLG_NULL)) {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &ra->s);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1524,7 +1524,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
if (!FILTER_GET_FLAG(ra->eflag, RANGE_FLG_NULL)) {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &ra->e);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1551,7 +1551,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
FLT_ERR_RET(filterAddUnit(dst, OP_TYPE_IS_NULL, &left, NULL, &uidx));
|
||||
FLT_ERR_RET(filterAddUnitToGroup(g, uidx));
|
||||
if (NULL == taosArrayPush(res,g)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1566,7 +1566,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
FLT_ERR_RET(filterAddUnit(dst, OP_TYPE_IS_NOT_NULL, &left, NULL, &uidx));
|
||||
FLT_ERR_RET(filterAddUnitToGroup(g, uidx));
|
||||
if (NULL == taosArrayPush(res,g)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1593,7 +1593,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
if (func(&r->ra.s, &r->ra.e) == 0) {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &r->ra.s);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1602,13 +1602,13 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
} else {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &r->ra.s);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
void *data2 = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data2 == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data2, &r->ra.e);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data2, FLD_TYPE_VALUE, &right2, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1621,7 +1621,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
}
|
||||
|
||||
if (NULL == taosArrayPush(res,g)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
r = r->next;
|
||||
|
@ -1632,7 +1632,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
if (!FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_NULL)) {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &r->ra.s);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1644,7 +1644,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
if (!FILTER_GET_FLAG(r->ra.eflag, RANGE_FLG_NULL)) {
|
||||
void *data = taosMemoryMalloc(sizeof(int64_t));
|
||||
if (data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
SIMPLE_COPY_VALUES(data, &r->ra.e);
|
||||
FLT_ERR_RET(filterAddField(dst, NULL, &data, FLD_TYPE_VALUE, &right, tDataTypes[type].bytes, true, NULL));
|
||||
|
@ -1659,7 +1659,7 @@ int32_t filterAddGroupUnitFromCtx(SFilterInfo *dst, SFilterInfo *src, SFilterRan
|
|||
}
|
||||
|
||||
if (NULL == taosArrayPush(res,g)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
r = r->next;
|
||||
|
@ -2437,7 +2437,7 @@ int32_t filterMergeGroupUnits(SFilterInfo *info, SFilterGroupCtx **gRes, int32_t
|
|||
uint32_t gResIdx = 0;
|
||||
uint32_t *colIdx = taosMemoryMalloc(info->fields[FLD_TYPE_COLUMN].num * sizeof(uint32_t));
|
||||
if (colIdx == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
for (uint32_t i = 0; i < info->groupNum; ++i) {
|
||||
SFilterGroup *g = info->groups + i;
|
||||
|
@ -2684,7 +2684,7 @@ int32_t filterMergeTwoGroups(SFilterInfo *info, SFilterGroupCtx **gRes1, SFilter
|
|||
colCtx.colIdx = idx1;
|
||||
colCtx.ctx = ctx;
|
||||
if (NULL == taosArrayPush(colCtxs, &colCtx)) {
|
||||
FLT_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_JRET(terrno);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
|
@ -2703,7 +2703,7 @@ int32_t filterMergeTwoGroups(SFilterInfo *info, SFilterGroupCtx **gRes1, SFilter
|
|||
colCtx.ctx = ctx;
|
||||
ctx = NULL;
|
||||
if (NULL == taosArrayPush(colCtxs, &colCtx)) {
|
||||
FLT_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_JRET(terrno);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -2717,7 +2717,7 @@ int32_t filterMergeTwoGroups(SFilterInfo *info, SFilterGroupCtx **gRes1, SFilter
|
|||
colCtx.ctx = ctx;
|
||||
ctx = NULL;
|
||||
if (NULL == taosArrayPush(colCtxs, &colCtx)) {
|
||||
FLT_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_JRET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2968,7 +2968,7 @@ int32_t filterRewrite(SFilterInfo *info, SFilterGroupCtx **gRes, int32_t gResNum
|
|||
|
||||
if (ng.unitNum > 0) {
|
||||
if (NULL == taosArrayPush(group, &ng)) {
|
||||
FLT_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_JRET(terrno);
|
||||
}
|
||||
ng = (SFilterGroup){0};
|
||||
}
|
||||
|
@ -3113,7 +3113,7 @@ int32_t filterGenerateComInfo(SFilterInfo *info) {
|
|||
info->blkUnitRes = taosMemoryMalloc(sizeof(*info->blkUnitRes) * info->unitNum);
|
||||
info->blkUnits = taosMemoryMalloc(sizeof(*info->blkUnits) * (info->unitNum + 1) * info->groupNum);
|
||||
if (NULL == info->cunits || NULL == info->blkUnitRes || NULL == info->blkUnits) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < info->unitNum; ++i) {
|
||||
|
@ -3835,11 +3835,11 @@ int32_t fltInitFromNode(SNode *tree, SFilterInfo *info, uint32_t options) {
|
|||
|
||||
info->unitRes = taosMemoryMalloc(info->unitNum * sizeof(*info->unitRes));
|
||||
if (info->unitRes == NULL) {
|
||||
FLT_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_JRET(terrno);
|
||||
}
|
||||
info->unitFlags = taosMemoryMalloc(info->unitNum * sizeof(*info->unitFlags));
|
||||
if (info->unitFlags == NULL) {
|
||||
FLT_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_JRET(terrno);
|
||||
}
|
||||
FLT_ERR_JRET(filterDumpInfoToString(info, "Final", 0));
|
||||
return code;
|
||||
|
@ -3987,12 +3987,12 @@ int32_t fltSclMergeSort(SArray *pts1, SArray *pts2, SArray *result) {
|
|||
bool less = fltSclLessPoint(pt1, pt2);
|
||||
if (less) {
|
||||
if (NULL == taosArrayPush(result, pt1)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
++i;
|
||||
} else {
|
||||
if (NULL == taosArrayPush(result, pt2)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
++j;
|
||||
}
|
||||
|
@ -4004,7 +4004,7 @@ int32_t fltSclMergeSort(SArray *pts1, SArray *pts2, SArray *result) {
|
|||
FLT_ERR_RET(TSDB_CODE_OUT_OF_RANGE);
|
||||
}
|
||||
if (NULL == taosArrayPush(result, pt1)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4015,7 +4015,7 @@ int32_t fltSclMergeSort(SArray *pts1, SArray *pts2, SArray *result) {
|
|||
FLT_ERR_RET(TSDB_CODE_OUT_OF_RANGE);
|
||||
}
|
||||
if (NULL == taosArrayPush(result, pt2)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4042,13 +4042,13 @@ int32_t fltSclMerge(SArray *pts1, SArray *pts2, bool isUnion, SArray *merged) {
|
|||
++count;
|
||||
if (count == countRequired) {
|
||||
if (NULL == taosArrayPush(merged, pt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (count == countRequired) {
|
||||
if (NULL == taosArrayPush(merged, pt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
--count;
|
||||
|
@ -4089,7 +4089,7 @@ int32_t fltSclGetOrCreateColumnRange(SColumnNode *colNode, SArray *colRangeList,
|
|||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(colRangeList, &newColRange)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
*colRange = taosArrayGetLast(colRangeList);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -4188,10 +4188,10 @@ int32_t fltSclBuildRangeFromBlockSma(SFltSclColumnRange *colRange, SColumnDataAg
|
|||
SFltSclPoint startPt = {.start = true, .excl = false, .val = datum};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = datum};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -4200,10 +4200,10 @@ int32_t fltSclBuildRangeFromBlockSma(SFltSclColumnRange *colRange, SColumnDataAg
|
|||
SFltSclPoint startPt = {.start = true, .excl = false, .val = nullDatum};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = nullDatum};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
SFltSclDatum min = {0};
|
||||
|
@ -4213,10 +4213,10 @@ int32_t fltSclBuildRangeFromBlockSma(SFltSclColumnRange *colRange, SColumnDataAg
|
|||
FLT_ERR_RET(fltSclBuildDatumFromBlockSmaValue(&max, colRange->colNode->node.resType.type, pAgg->max));
|
||||
SFltSclPoint maxPt = {.excl = false, .start = false, .val = max};
|
||||
if (NULL == taosArrayPush(points, &minPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &maxPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -4242,7 +4242,7 @@ int32_t filterRangeExecute(SFilterInfo *info, SColumnDataAgg *pDataStatis, int32
|
|||
SColumnDataAgg *pAgg = &pDataStatis[j];
|
||||
SArray *points = taosArrayInit(2, sizeof(SFltSclPoint));
|
||||
if (NULL == points) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
FLT_ERR_RET(fltSclBuildRangeFromBlockSma(colRange, pAgg, numOfRows, points));
|
||||
qDebug("column data agg: nulls %d, rows %d, max %" PRId64 " min %" PRId64, pAgg->numOfNull, numOfRows,
|
||||
|
@ -4250,7 +4250,7 @@ int32_t filterRangeExecute(SFilterInfo *info, SColumnDataAgg *pDataStatis, int32
|
|||
|
||||
SArray *merged = taosArrayInit(8, sizeof(SFltSclPoint));
|
||||
if (NULL == merged) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
FLT_ERR_RET(fltSclIntersect(points, colRange->points, merged));
|
||||
bool isIntersect = taosArrayGetSize(merged) != 0;
|
||||
|
@ -4570,7 +4570,7 @@ int32_t filterConverNcharColumns(SFilterInfo *info, int32_t rows, bool *gotNchar
|
|||
int32_t bytes = FILTER_GET_COL_FIELD_SIZE(fi);
|
||||
nfi.data = taosMemoryMalloc(rows * bytes);
|
||||
if (nfi.data == NULL) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
int32_t bufSize = bytes - VARSTR_HEADER_SIZE;
|
||||
for (int32_t j = 0; j < rows; ++j) {
|
||||
|
@ -4629,7 +4629,7 @@ int32_t fltAddValueNodeToConverList(SFltTreeStat *stat, SValueNode *pNode) {
|
|||
}
|
||||
|
||||
if (NULL == taosArrayPush(stat->nodeList, &pNode)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -4881,10 +4881,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclDatum end = {.kind = FLT_SCL_DATUM_KIND_MAX, .type = oper->colNode->node.resType};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = end};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4895,10 +4895,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclDatum end = {.kind = FLT_SCL_DATUM_KIND_MAX, .type = oper->colNode->node.resType};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = end};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4909,10 +4909,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclDatum start = {.kind = FLT_SCL_DATUM_KIND_MIN, .type = oper->colNode->node.resType};
|
||||
SFltSclPoint startPt = {.start = true, .excl = false, .val = start};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4923,10 +4923,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclDatum start = {.kind = FLT_SCL_DATUM_KIND_MIN, .type = oper->colNode->node.resType};
|
||||
SFltSclPoint startPt = {.start = true, .excl = false, .val = start};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4936,10 +4936,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclPoint startPt = {.start = true, .excl = false, .val = valDatum};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = valDatum};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4951,10 +4951,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclPoint startPt = {.start = true, .excl = false, .val = start};
|
||||
SFltSclPoint endPt = {.start = false, .excl = true, .val = valDatum};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
{
|
||||
|
@ -4962,10 +4962,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclDatum end = {.kind = FLT_SCL_DATUM_KIND_MAX, .type = oper->colNode->node.resType};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = end};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -4975,10 +4975,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclPoint startPt = {.start = true, .excl = false, .val = nullDatum};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = nullDatum};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4988,10 +4988,10 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
|
|||
SFltSclDatum maxDatum = {.kind = FLT_SCL_DATUM_KIND_MAX, .type = oper->colNode->node.resType};
|
||||
SFltSclPoint endPt = {.start = false, .excl = false, .val = maxDatum};
|
||||
if (NULL == taosArrayPush(points, &startPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
if (NULL == taosArrayPush(points, &endPt)) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -5082,7 +5082,7 @@ static int32_t fltSclCollectOperatorFromNode(SNode *pNode, SArray *sclOpList) {
|
|||
if (NULL == taosArrayPush(sclOpList, &sclOp)) {
|
||||
nodesDestroyNode(pLeft);
|
||||
nodesDestroyNode(pRight);
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
FLT_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ int32_t sclCopyValueNodeValue(SValueNode *pNode, void **res) {
|
|||
*res = taosMemoryMalloc(pNode->node.resType.bytes);
|
||||
if (NULL == (*res)) {
|
||||
sclError("malloc %d failed", pNode->node.resType.bytes);
|
||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCL_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
(void)memcpy(*res, nodesGetValueFromNode(pNode), pNode->node.resType.bytes);
|
||||
|
|
|
@ -1178,7 +1178,7 @@ int32_t substrFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu
|
|||
char *outputBuf = taosMemoryMalloc(outputLen);
|
||||
if (outputBuf == NULL) {
|
||||
qError("substr function memory allocation failure. size: %d", outputLen);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t numOfRows = 0;
|
||||
|
@ -1271,7 +1271,7 @@ int32_t md5Function(SScalarParam* pInput, int32_t inputNum, SScalarParam* pOutpu
|
|||
char* pOutputBuf = taosMemoryMalloc(bufLen);
|
||||
if (!pOutputBuf) {
|
||||
qError("md5 function alloc memory failed");
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
for (int32_t i = 0; i < pInput->numOfRows; ++i) {
|
||||
if (colDataIsNull_s(pInputData, i)) {
|
||||
|
@ -1284,7 +1284,7 @@ int32_t md5Function(SScalarParam* pInput, int32_t inputNum, SScalarParam* pOutpu
|
|||
pOutputBuf = taosMemoryRealloc(pOutputBuf, bufLen);
|
||||
if (!pOutputBuf) {
|
||||
qError("md5 function alloc memory failed");
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
char *output = pOutputBuf;
|
||||
|
@ -2306,7 +2306,7 @@ int32_t toJsonFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu
|
|||
for (int32_t i = 0; i < pInput[0].numOfRows; ++i) {
|
||||
SArray *pTagVals = taosArrayInit(8, sizeof(STagVal));
|
||||
if (NULL == pTagVals) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
STag *pTag = NULL;
|
||||
|
||||
|
@ -2356,7 +2356,7 @@ int32_t toTimestampFunction(SScalarParam* pInput, int32_t inputNum, SScalarParam
|
|||
SArray *formats = NULL;
|
||||
|
||||
if (tsStr == NULL || format == NULL) {
|
||||
SCL_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCL_ERR_JRET(terrno);
|
||||
}
|
||||
for (int32_t i = 0; i < pInput[0].numOfRows; ++i) {
|
||||
if (colDataIsNull_s(pInput[1].columnData, i) || colDataIsNull_s(pInput[0].columnData, i)) {
|
||||
|
|
|
@ -101,7 +101,7 @@ int32_t convertNcharToDouble(const void *inData, void *outData) {
|
|||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
char *tmp = taosMemoryMalloc(varDataTLen(inData));
|
||||
if (NULL == tmp) {
|
||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCL_ERR_RET(terrno);
|
||||
}
|
||||
int len = taosUcs4ToMbs((TdUcs4 *)varDataVal(inData), varDataLen(inData), tmp);
|
||||
if (len < 0) {
|
||||
|
@ -540,7 +540,7 @@ int32_t vectorConvertFromVarData(SSclVectorConvCtx *pCtx, int32_t *overflow) {
|
|||
tmp = taosMemoryMalloc(bufSize);
|
||||
if (tmp == NULL) {
|
||||
sclError("out of memory in vectorConvertFromVarData");
|
||||
SCL_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCL_ERR_JRET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ int32_t schChkJobNeedFlowCtrl(SSchJob *pJob, SSchLevel *pLevel) {
|
|||
taosHashInit(pJob->taskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
|
||||
if (NULL == pJob->flowCtrl) {
|
||||
SCH_JOB_ELOG("taosHashInit %d flowCtrl failed", pJob->taskNum);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
SCH_SET_JOB_NEED_FLOW_CTRL(pJob);
|
||||
|
@ -160,13 +160,13 @@ int32_t schCheckIncTaskFlowQuota(SSchJob *pJob, SSchTask *pTask, bool *enough) {
|
|||
ctrl->taskList = taosArrayInit(pLevel->taskNum, POINTER_BYTES);
|
||||
if (NULL == ctrl->taskList) {
|
||||
SCH_TASK_ELOG("taosArrayInit taskList failed, size:%d", (int32_t)pLevel->taskNum);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL == taosArrayPush(ctrl->taskList, &pTask)) {
|
||||
SCH_TASK_ELOG("taosArrayPush to taskList failed, size:%d", (int32_t)taosArrayGetSize(ctrl->taskList));
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
*enough = false;
|
||||
|
|
|
@ -192,7 +192,7 @@ int32_t schBuildTaskRalation(SSchJob *pJob, SHashObj *planToTask) {
|
|||
pTask->children = taosArrayInit(childNum, POINTER_BYTES);
|
||||
if (NULL == pTask->children) {
|
||||
SCH_TASK_ELOG("taosArrayInit %d children failed", childNum);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ int32_t schBuildTaskRalation(SSchJob *pJob, SHashObj *planToTask) {
|
|||
|
||||
if (NULL == taosArrayPush(pTask->children, childTask)) {
|
||||
SCH_TASK_ELOG("taosArrayPush childTask failed, level:%d, taskIdx:%d, childIdx:%d", i, m, n);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
SCH_TASK_DLOG("children info, the %d child TID 0x%" PRIx64, n, (*childTask)->taskId);
|
||||
|
@ -226,7 +226,7 @@ int32_t schBuildTaskRalation(SSchJob *pJob, SHashObj *planToTask) {
|
|||
pTask->parents = taosArrayInit(parentNum, POINTER_BYTES);
|
||||
if (NULL == pTask->parents) {
|
||||
SCH_TASK_ELOG("taosArrayInit %d parents failed", parentNum);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
} else {
|
||||
if (0 != pLevel->level) {
|
||||
|
@ -250,7 +250,7 @@ int32_t schBuildTaskRalation(SSchJob *pJob, SHashObj *planToTask) {
|
|||
|
||||
if (NULL == taosArrayPush(pTask->parents, parentTask)) {
|
||||
SCH_TASK_ELOG("taosArrayPush parentTask failed, level:%d, taskIdx:%d, childIdx:%d", i, m, n);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
SCH_TASK_DLOG("parents info, the %d parent TID 0x%" PRIx64, n, (*parentTask)->taskId);
|
||||
|
@ -309,7 +309,7 @@ int32_t schValidateAndBuildJob(SQueryPlan *pDag, SSchJob *pJob) {
|
|||
|
||||
pJob->dataSrcTasks = taosArrayInit(pDag->numOfSubplans, POINTER_BYTES);
|
||||
if (NULL == pJob->dataSrcTasks) {
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
int32_t levelNum = (int32_t)LIST_LENGTH(pDag->pSubplans);
|
||||
|
@ -324,13 +324,13 @@ int32_t schValidateAndBuildJob(SQueryPlan *pDag, SSchJob *pJob) {
|
|||
HASH_NO_LOCK);
|
||||
if (NULL == planToTask) {
|
||||
SCH_JOB_ELOG("taosHashInit %d failed", SCHEDULE_DEFAULT_MAX_TASK_NUM);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
pJob->levels = taosArrayInit(levelNum, sizeof(SSchLevel));
|
||||
if (NULL == pJob->levels) {
|
||||
SCH_JOB_ELOG("taosArrayInit %d failed", levelNum);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
pJob->levelNum = levelNum;
|
||||
|
@ -346,7 +346,7 @@ int32_t schValidateAndBuildJob(SQueryPlan *pDag, SSchJob *pJob) {
|
|||
for (int32_t i = 0; i < levelNum; ++i) {
|
||||
if (NULL == taosArrayPush(pJob->levels, &level)) {
|
||||
SCH_JOB_ELOG("taosArrayPush level failed, level:%d", i);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
pLevel = taosArrayGet(pJob->levels, i);
|
||||
|
@ -374,7 +374,7 @@ int32_t schValidateAndBuildJob(SQueryPlan *pDag, SSchJob *pJob) {
|
|||
pLevel->subTasks = taosArrayInit(taskNum, sizeof(SSchTask));
|
||||
if (NULL == pLevel->subTasks) {
|
||||
SCH_JOB_ELOG("taosArrayInit %d failed", taskNum);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
for (int32_t n = 0; n < taskNum; ++n) {
|
||||
|
@ -390,7 +390,7 @@ int32_t schValidateAndBuildJob(SQueryPlan *pDag, SSchJob *pJob) {
|
|||
SSchTask *pTask = taosArrayPush(pLevel->subTasks, &task);
|
||||
if (NULL == pTask) {
|
||||
SCH_TASK_ELOG("taosArrayPush task to level failed, level:%d, taskIdx:%d", pLevel->level, n);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
SCH_ERR_JRET(schInitTask(pJob, pTask, plan, pLevel));
|
||||
|
@ -662,7 +662,7 @@ int32_t schSaveJobExecRes(SSchJob *pJob, SQueryTableRsp *rsp) {
|
|||
pJob->execRes.res = taosArrayInit(pJob->taskNum, sizeof(STbVerInfo));
|
||||
if (NULL == pJob->execRes.res) {
|
||||
SCH_UNLOCK(SCH_WRITE, &pJob->resLock);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -832,7 +832,7 @@ int32_t schInitJob(int64_t *pJobId, SSchedulerReq *pReq) {
|
|||
pJob->sql = taosStrdup(pReq->sql);
|
||||
if (NULL == pJob->sql) {
|
||||
qError("qid:0x%" PRIx64 " strdup sql %s failed", pReq->pDag->queryId, pReq->sql);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
}
|
||||
pJob->pDag = pReq->pDag;
|
||||
|
@ -865,7 +865,7 @@ int32_t schInitJob(int64_t *pJobId, SSchedulerReq *pReq) {
|
|||
HASH_ENTRY_LOCK);
|
||||
if (NULL == pJob->taskList) {
|
||||
SCH_JOB_ELOG("taosHashInit %d taskList failed", pReq->pDag->numOfSubplans);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
SCH_ERR_JRET(schValidateAndBuildJob(pReq->pDag, pJob));
|
||||
|
@ -878,7 +878,7 @@ int32_t schInitJob(int64_t *pJobId, SSchedulerReq *pReq) {
|
|||
HASH_ENTRY_LOCK);
|
||||
if (NULL == pJob->execTasks) {
|
||||
SCH_JOB_ELOG("taosHashInit %d execTasks failed", pReq->pDag->numOfSubplans);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
if (tsem_init(&pJob->rspSem, 0, 0)) {
|
||||
|
|
|
@ -750,7 +750,7 @@ int32_t schCloneHbRpcCtx(SRpcCtx *pSrc, SRpcCtx *pDst) {
|
|||
pDst->args = taosHashInit(1, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_ENTRY_LOCK);
|
||||
if (NULL == pDst->args) {
|
||||
qError("taosHashInit %d RpcCtx failed", 1);
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
SRpcCtxVal dst = {0};
|
||||
|
@ -794,7 +794,7 @@ int32_t schMakeHbRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) {
|
|||
pCtx->args = taosHashInit(1, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_ENTRY_LOCK);
|
||||
if (NULL == pCtx->args) {
|
||||
SCH_TASK_ELOG("taosHashInit %d RpcCtx failed", 1);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
pMsgSendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
|
||||
|
@ -868,7 +868,7 @@ int32_t schMakeQueryRpcCtx(SSchJob *pJob, SSchTask *pTask, SRpcCtx *pCtx) {
|
|||
pCtx->args = taosHashInit(1, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_ENTRY_LOCK);
|
||||
if (NULL == pCtx->args) {
|
||||
SCH_TASK_ELOG("taosHashInit %d RpcCtx failed", 1);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
SSchTrans trans = {.pTrans = pJob->conn.pTrans, .pHandle = SCH_GET_TASK_HANDLE(pTask)};
|
||||
|
@ -903,7 +903,7 @@ int32_t schCloneCallbackParam(SSchCallbackParamHeader *pSrc, SSchCallbackParamHe
|
|||
SSchHbCallbackParam *dst = taosMemoryMalloc(sizeof(SSchHbCallbackParam));
|
||||
if (NULL == dst) {
|
||||
qError("malloc SSchHbCallbackParam failed");
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
TAOS_MEMCPY(dst, pSrc, sizeof(*dst));
|
||||
|
@ -915,7 +915,7 @@ int32_t schCloneCallbackParam(SSchCallbackParamHeader *pSrc, SSchCallbackParamHe
|
|||
SSchTaskCallbackParam *dst = taosMemoryMalloc(sizeof(SSchTaskCallbackParam));
|
||||
if (NULL == dst) {
|
||||
qError("malloc SSchTaskCallbackParam failed");
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
TAOS_MEMCPY(dst, pSrc, sizeof(*dst));
|
||||
|
|
|
@ -74,7 +74,7 @@ int32_t schInitTask(SSchJob *pJob, SSchTask *pTask, SSubplan *pPlan, SSchLevel *
|
|||
taosHashInit(pTask->maxExecTimes, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
|
||||
pTask->profile.execTime = taosArrayInit(pTask->maxExecTimes, sizeof(int64_t));
|
||||
if (NULL == pTask->execNodes || NULL == pTask->profile.execTime) {
|
||||
SCH_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_JRET(terrno);
|
||||
}
|
||||
|
||||
SCH_SET_TASK_STATUS(pTask, JOB_TASK_STATUS_INIT);
|
||||
|
@ -786,7 +786,7 @@ int32_t schSetAddrsFromNodeList(SSchJob *pJob, SSchTask *pTask) {
|
|||
|
||||
if (NULL == taosArrayPush(pTask->candidateAddrs, naddr)) {
|
||||
SCH_TASK_ELOG("taosArrayPush execNode to candidate addrs failed, addNum:%d, errno:%d", addNum, errno);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
SCH_TASK_TLOG("set %dth candidate addr, id %d, inUse:%d/%d, fqdn:%s, port:%d", i, naddr->nodeId,
|
||||
|
@ -813,13 +813,13 @@ int32_t schSetTaskCandidateAddrs(SSchJob *pJob, SSchTask *pTask) {
|
|||
pTask->candidateAddrs = taosArrayInit(SCHEDULE_DEFAULT_MAX_NODE_NUM, sizeof(SQueryNodeAddr));
|
||||
if (NULL == pTask->candidateAddrs) {
|
||||
SCH_TASK_ELOG("taosArrayInit %d condidate addrs failed", SCHEDULE_DEFAULT_MAX_NODE_NUM);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
if (pTask->plan->execNode.epSet.numOfEps > 0) {
|
||||
if (NULL == taosArrayPush(pTask->candidateAddrs, &pTask->plan->execNode)) {
|
||||
SCH_TASK_ELOG("taosArrayPush execNode to candidate addrs failed, errno:%d", errno);
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
SCH_TASK_DLOG("use execNode in plan as candidate addr, numOfEps:%d", pTask->plan->execNode.epSet.numOfEps);
|
||||
|
@ -1304,7 +1304,7 @@ int32_t schDelayLaunchTask(SSchJob *pJob, SSchTask *pTask) {
|
|||
SSchTimerParam *param = taosMemoryMalloc(sizeof(SSchTimerParam));
|
||||
if (NULL == param) {
|
||||
SCH_TASK_ELOG("taosMemoryMalloc %d failed", (int)sizeof(SSchTimerParam));
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
param->rId = pJob->refId;
|
||||
|
|
|
@ -47,7 +47,7 @@ int32_t schedulerInit() {
|
|||
schMgmt.hbConnections = taosHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
|
||||
if (NULL == schMgmt.hbConnections) {
|
||||
qError("taosHashInit hb connections failed");
|
||||
SCH_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SCH_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
schMgmt.timer = taosTmrInit(0, 0, 0, "scheduler");
|
||||
|
|
|
@ -412,7 +412,7 @@ int32_t remoteChkpGetDelFile(char* path, SArray* toDel) {
|
|||
if (taosArrayPush(toDel, &p) == NULL) {
|
||||
taosMemoryFree(pMeta);
|
||||
taosMemoryFree(p);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1102,17 +1102,17 @@ int32_t chkpMayDelObsolete(void* arg, int64_t chkpId, char* path) {
|
|||
(void)taosThreadRwlockWrlock(&pBackend->chkpDirLock);
|
||||
|
||||
if (taosArrayPush(pBackend->chkpSaved, &chkpId) == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
|
||||
chkpDel = taosArrayInit(8, sizeof(int64_t));
|
||||
if (chkpDel == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
|
||||
chkpDup = taosArrayInit(8, sizeof(int64_t));
|
||||
if (chkpDup == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
|
||||
int64_t firsId = 0;
|
||||
|
@ -1123,11 +1123,11 @@ int32_t chkpMayDelObsolete(void* arg, int64_t chkpId, char* path) {
|
|||
int64_t id = *(int64_t*)taosArrayGet(pBackend->chkpSaved, i);
|
||||
if (id >= firsId) {
|
||||
if (taosArrayPush(chkpDup, &id) == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
} else {
|
||||
if (taosArrayPush(chkpDel, &id) == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1138,13 +1138,13 @@ int32_t chkpMayDelObsolete(void* arg, int64_t chkpId, char* path) {
|
|||
for (int i = 0; i < dsz; i++) {
|
||||
int64_t id = *(int64_t*)taosArrayGet(pBackend->chkpSaved, i);
|
||||
if (taosArrayPush(chkpDel, &id) == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
}
|
||||
for (int i = dsz < 0 ? 0 : dsz; i < sz; i++) {
|
||||
int64_t id = *(int64_t*)taosArrayGet(pBackend->chkpSaved, i);
|
||||
if (taosArrayPush(chkpDup, &id) == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ int32_t taskDbLoadChkpInfo(STaskDbWrapper* pBackend) {
|
|||
int ret = sscanf(taosGetDirEntryName(de), "checkpoint%" PRId64 "", &checkpointId);
|
||||
if (ret == 1) {
|
||||
if (taosArrayPush(pBackend->chkpSaved, &checkpointId) == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -1330,7 +1330,7 @@ int32_t chkpGetAllDbCfHandle2(STaskDbWrapper* pBackend, rocksdb_column_family_ha
|
|||
if (pBackend->pCf[i]) {
|
||||
rocksdb_column_family_handle_t* p = pBackend->pCf[i];
|
||||
if (taosArrayPush(pHandle, &p) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exception;
|
||||
}
|
||||
}
|
||||
|
@ -1485,7 +1485,7 @@ int32_t taskDbBuildSnap(void* arg, SArray* pSnap) {
|
|||
// remove chkpid from chkp-in-use set
|
||||
taskDbUnRefChkp(pTaskDb, pTaskDb->chkpId);
|
||||
taskDbRemoveRef(pTaskDb);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
if (taosArrayPush(pSnap, &snap) == NULL) {
|
||||
|
@ -4933,12 +4933,12 @@ int32_t dbChkpDumpTo(SDbChkp* p, char* dname, SArray* list) {
|
|||
char* filename = taosArrayGetP(p->pDel, i);
|
||||
char* p = taosStrdup(filename);
|
||||
if (p == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _ERROR;
|
||||
}
|
||||
if (taosArrayPush(list, &p) == NULL) {
|
||||
taosMemoryFree(p);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -5039,14 +5039,14 @@ int32_t bkdMgtCreate(char* path, SBkdMgt** mgt) {
|
|||
|
||||
p->pDbChkpTbl = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK);
|
||||
if (p->pDbChkpTbl == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
bkdMgtDestroy(p);
|
||||
return code;
|
||||
}
|
||||
|
||||
p->path = taosStrdup(path);
|
||||
if (p->path == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
bkdMgtDestroy(p);
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -865,7 +865,7 @@ int32_t initCheckpointReadyMsg(SStreamTask* pTask, int32_t upstreamNodeId, int32
|
|||
|
||||
buf = rpcMallocCont(sizeof(SMsgHead) + tlen);
|
||||
if (buf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
((SMsgHead*)buf)->vgId = htonl(req.upstreamNodeId);
|
||||
|
@ -1280,7 +1280,7 @@ int32_t streamTaskBuildCheckpointSourceRsp(SStreamCheckpointSourceReq* pReq, SRp
|
|||
|
||||
void* pBuf = rpcMallocCont(sizeof(SMsgHead) + len);
|
||||
if (pBuf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
((SMsgHead*)pBuf)->vgId = htonl(pReq->mnodeId);
|
||||
|
@ -1668,7 +1668,7 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i
|
|||
static int32_t buildDispatchRsp(const SStreamTask* pTask, const SStreamDispatchReq* pReq, int32_t status, void** pBuf) {
|
||||
*pBuf = rpcMallocCont(sizeof(SMsgHead) + sizeof(SStreamDispatchRsp));
|
||||
if (*pBuf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
((SMsgHead*)(*pBuf))->vgId = htonl(pReq->upstreamNodeId);
|
||||
|
|
|
@ -153,7 +153,6 @@ int32_t streamMetaSendHbHelper(SStreamMeta* pMeta) {
|
|||
pMsg->pUpdateNodes = taosArrayInit(numOfTasks, sizeof(int32_t));
|
||||
|
||||
if (pMsg->pTaskStatus == NULL || pMsg->pUpdateNodes == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ int32_t metaRefMgtInit() {
|
|||
}
|
||||
|
||||
if (gMetaRefMgt.pTable == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
} else {
|
||||
return code;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ int32_t metaRefMgtAdd(int64_t vgId, int64_t* rid) {
|
|||
|
||||
p = taosArrayPush(pList, &rid);
|
||||
if (p == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
code = taosHashPut(gMetaRefMgt.pTable, &vgId, sizeof(vgId), &pList, sizeof(void*));
|
||||
|
@ -138,7 +138,7 @@ int32_t metaRefMgtAdd(int64_t vgId, int64_t* rid) {
|
|||
SArray* list = *(SArray**)p;
|
||||
void* px = taosArrayPush(list, &rid);
|
||||
if (px == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -718,7 +718,7 @@ int32_t streamMetaRegisterTask(SStreamMeta* pMeta, int64_t ver, SStreamTask* pTa
|
|||
p = taosArrayPush(pMeta->pTaskList, &pTask->id);
|
||||
if (p == NULL) {
|
||||
stError("s-task:0x%" PRIx64 " failed to register task into meta-list, code: out of memory", id.taskId);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
code = taosHashPut(pMeta->pTasksMap, &id, sizeof(id), &pTask, POINTER_BYTES);
|
||||
|
|
|
@ -384,13 +384,13 @@ int32_t streamTaskPutTranstateIntoInputQ(SStreamTask* pTask) {
|
|||
|
||||
pTranstate->blocks = taosArrayInit(4, sizeof(SSDataBlock)); // pBlock;
|
||||
if (pTranstate->blocks == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _err;
|
||||
}
|
||||
|
||||
void* p = taosArrayPush(pTranstate->blocks, pBlock);
|
||||
if (p == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue