enh:modify error code passing in libs/
This commit is contained in:
parent
abfa7a1279
commit
b6a8619d40
|
@ -43,7 +43,7 @@ int32_t doMakePointFunc(double x, double y, unsigned char **output) {
|
|||
|
||||
*output = taosMemoryCalloc(1, size + VARSTR_HEADER_SIZE);
|
||||
if (*output == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ int32_t doGeomFromTextFunc(const char *input, unsigned char **output) {
|
|||
// make a zero ending string
|
||||
inputGeom = taosMemoryCalloc(1, varDataLen(input) + 1);
|
||||
if (inputGeom == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
(void)memcpy(inputGeom, varDataVal(input), varDataLen(input));
|
||||
|
@ -83,7 +83,7 @@ int32_t doGeomFromTextFunc(const char *input, unsigned char **output) {
|
|||
|
||||
*output = taosMemoryCalloc(1, size + VARSTR_HEADER_SIZE);
|
||||
if (*output == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ int32_t doAsTextFunc(unsigned char *input, char **output) {
|
|||
size_t size = strlen(outputWKT);
|
||||
*output = taosMemoryCalloc(1, size + VARSTR_HEADER_SIZE);
|
||||
if (*output == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ static int32_t initWktRegex(pcre2_code **ppRegex, pcre2_match_data **ppMatchData
|
|||
int32_t code = 0;
|
||||
char *wktPatternWithSpace = taosMemoryCalloc(4, 1024);
|
||||
if (NULL == wktPatternWithSpace) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(void)sprintf(
|
||||
|
|
|
@ -112,7 +112,7 @@ int32_t indexOpen(SIndexOpts* opts, const char* path, SIndex** index) {
|
|||
int code = TSDB_CODE_SUCCESS;
|
||||
SIndex* idx = taosMemoryCalloc(1, sizeof(SIndex));
|
||||
if (idx == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, END);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, END);
|
||||
}
|
||||
|
||||
idx->lru = taosLRUCacheInit(opts->cacheSize, -1, .5);
|
||||
|
|
|
@ -137,7 +137,7 @@ static int32_t cacheSearchCompareFunc(void* cache, SIndexTerm* term, SIdxTRslt*
|
|||
|
||||
CacheTerm* pCt = taosMemoryCalloc(1, sizeof(CacheTerm));
|
||||
if (pCt == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pCt->colVal = term->colVal;
|
||||
|
@ -206,7 +206,7 @@ static int32_t cacheSearchTerm_JSON(void* cache, SIndexTerm* term, SIdxTRslt* tr
|
|||
|
||||
CacheTerm* pCt = taosMemoryCalloc(1, sizeof(CacheTerm));
|
||||
if (pCt == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pCt->colVal = term->colVal;
|
||||
|
@ -584,7 +584,7 @@ int idxCachePut(void* cache, SIndexTerm* term, uint64_t uid) {
|
|||
// encode data
|
||||
CacheTerm* ct = taosMemoryCalloc(1, sizeof(CacheTerm));
|
||||
if (ct == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
// set up key
|
||||
ct->colType = term->colType;
|
||||
|
@ -594,7 +594,7 @@ int idxCachePut(void* cache, SIndexTerm* term, uint64_t uid) {
|
|||
ct->colVal = (char*)taosMemoryCalloc(1, sizeof(char) * (term->nColVal + 1));
|
||||
if (ct->colVal == NULL) {
|
||||
taosMemoryFree(ct);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
memcpy(ct->colVal, term->colVal, term->nColVal);
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)idxInt2str(*(int64_t*)src, *dst, -1);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -332,7 +332,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_UTINYINT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)idxInt2str(*(uint8_t*)src, *dst, 1);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -340,7 +340,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_TINYINT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)idxInt2str(*(int8_t*)src, *dst, 1);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -348,7 +348,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_SMALLINT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)idxInt2str(*(int16_t*)src, *dst, -1);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -361,7 +361,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_INT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)idxInt2str(*(int32_t*)src, *dst, -1);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -369,7 +369,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_UINT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)idxInt2str(*(uint32_t*)src, *dst, 1);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -377,7 +377,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_BIGINT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
sprintf(*dst, "%" PRIu64, *(uint64_t*)src);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -385,7 +385,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_UBIGINT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)idxInt2str(*(uint64_t*)src, *dst, 1);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -393,7 +393,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_FLOAT:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
sprintf(*dst, "%.9lf", *(float*)src);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -401,7 +401,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
case TSDB_DATA_TYPE_DOUBLE:
|
||||
*dst = taosMemoryCalloc(1, bufSize + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
sprintf(*dst, "%.9lf", *(double*)src);
|
||||
tlen = strlen(*dst);
|
||||
|
@ -410,7 +410,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
tlen = taosEncodeBinary(NULL, varDataVal(src), varDataLen(src));
|
||||
*dst = taosMemoryCalloc(1, tlen + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
tlen = taosEncodeBinary(dst, varDataVal(src), varDataLen(src));
|
||||
*dst = (char*)*dst - tlen;
|
||||
|
@ -422,7 +422,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
|
|||
tlen = taosEncodeBinary(NULL, varDataVal(src), varDataLen(src));
|
||||
*dst = taosMemoryCalloc(1, tlen + 1);
|
||||
if (*dst == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
tlen = taosEncodeBinary(dst, varDataVal(src), varDataLen(src));
|
||||
*dst = (char*)*dst - tlen;
|
||||
|
|
|
@ -197,7 +197,7 @@ static FORCE_INLINE int32_t sifGetValueFromNode(SNode *node, char **value) {
|
|||
}
|
||||
char *tv = taosMemoryCalloc(1, valLen + 1);
|
||||
if (tv == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
memcpy(tv, pData, valLen);
|
||||
|
@ -273,7 +273,7 @@ static int32_t sifInitParamValByCol(SNode *r, SNode *l, SIFParam *param, SIFCtx
|
|||
}
|
||||
char *tv = taosMemoryCalloc(1, valLen + 1);
|
||||
if (tv == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
memcpy(tv, pData, valLen);
|
||||
|
@ -373,7 +373,7 @@ static int32_t sifInitOperParams(SIFParam **params, SOperatorNode *node, SIFCtx
|
|||
SIFParam *paramList = taosMemoryCalloc(nParam, sizeof(SIFParam));
|
||||
|
||||
if (NULL == paramList) {
|
||||
SIF_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SIF_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
if (nodeType(node->pLeft) == QUERY_NODE_OPERATOR &&
|
||||
|
@ -405,7 +405,7 @@ static int32_t sifInitParamList(SIFParam **params, SNodeList *nodeList, SIFCtx *
|
|||
SIFParam *tParams = taosMemoryCalloc(nodeList->length, sizeof(SIFParam));
|
||||
if (tParams == NULL) {
|
||||
indexError("failed to calloc, nodeList: %p", nodeList);
|
||||
SIF_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
SIF_ERR_RET(terrno);
|
||||
}
|
||||
|
||||
SListCell *cell = nodeList->pHead;
|
||||
|
|
|
@ -201,7 +201,7 @@ int32_t tfileReaderCreate(IFileCtx* ctx, TFileReader** pReader) {
|
|||
int32_t code = 0;
|
||||
TFileReader* reader = taosMemoryCalloc(1, sizeof(TFileReader));
|
||||
if (reader == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
reader->ctx = ctx;
|
||||
reader->remove = false;
|
||||
|
@ -609,7 +609,7 @@ int32_t tfileWriterCreate(IFileCtx* ctx, TFileHeader* header, TFileWriter** pWri
|
|||
int32_t code = 0;
|
||||
TFileWriter* tw = taosMemoryCalloc(1, sizeof(TFileWriter));
|
||||
if (tw == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
indexError("index: %" PRIu64 " failed to alloc TFilerWriter since %s", header->suid, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ int32_t tfileWriterPut(TFileWriter* tw, void* data, bool order) {
|
|||
int32_t cap = 4 * 1024;
|
||||
char* buf = taosMemoryCalloc(1, cap);
|
||||
if (buf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < sz; i++) {
|
||||
|
@ -1137,7 +1137,7 @@ static int32_t tfileGetFileList(const char* path, SArray** ppResult) {
|
|||
size_t len = strlen(path) + 1 + strlen(file) + 1;
|
||||
char* buf = taosMemoryCalloc(1, len);
|
||||
if (buf == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
|
||||
TAOS_CHECK_GOTO(terrno, NULL, _exception);
|
||||
}
|
||||
|
||||
sprintf(buf, "%s/%s", path, file);
|
||||
|
|
|
@ -44,7 +44,7 @@ int32_t iIntersection(SArray *in, SArray *out) {
|
|||
}
|
||||
MergeIndex *mi = taosMemoryCalloc(sz, sizeof(MergeIndex));
|
||||
if (mi == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
for (int i = 0; i < sz; i++) {
|
||||
SArray *t = taosArrayGetP(in, i);
|
||||
|
|
|
@ -179,7 +179,7 @@ static int32_t valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) {
|
|||
int32_t len = pSrc->node.resType.bytes + 1;
|
||||
pDst->datum.p = taosMemoryCalloc(1, len);
|
||||
if (NULL == pDst->datum.p) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
memcpy(pDst->datum.p, pSrc->datum.p, len);
|
||||
break;
|
||||
|
@ -188,7 +188,7 @@ static int32_t valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) {
|
|||
int32_t len = getJsonValueLen(pSrc->datum.p);
|
||||
pDst->datum.p = taosMemoryCalloc(1, len);
|
||||
if (NULL == pDst->datum.p) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
memcpy(pDst->datum.p, pSrc->datum.p, len);
|
||||
break;
|
||||
|
|
|
@ -4083,14 +4083,14 @@ static int32_t jsonToDatum(const SJson* pJson, void* pObj) {
|
|||
case TSDB_DATA_TYPE_GEOMETRY: {
|
||||
pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes + 1);
|
||||
if (NULL == pNode->datum.p) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
varDataSetLen(pNode->datum.p, pNode->node.resType.bytes - VARSTR_HEADER_SIZE);
|
||||
if (TSDB_DATA_TYPE_NCHAR == pNode->node.resType.type) {
|
||||
char* buf = taosMemoryCalloc(1, pNode->node.resType.bytes * 2 + VARSTR_HEADER_SIZE + 1);
|
||||
if (NULL == buf) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
code = tjsonGetStringValue(pJson, jkValueDatum, buf);
|
||||
|
@ -4112,12 +4112,12 @@ static int32_t jsonToDatum(const SJson* pJson, void* pObj) {
|
|||
case TSDB_DATA_TYPE_JSON: {
|
||||
pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes);
|
||||
if (NULL == pNode->datum.p) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
char* buf = taosMemoryCalloc(1, pNode->node.resType.bytes * 2 + 1);
|
||||
if (NULL == buf) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
code = tjsonGetStringValue(pJson, jkValueDatum, buf);
|
||||
|
|
|
@ -952,7 +952,7 @@ static int32_t msgToDatum(STlv* pTlv, void* pObj) {
|
|||
}
|
||||
pNode->datum.p = taosMemoryCalloc(1, pNode->node.resType.bytes + 1);
|
||||
if (NULL == pNode->datum.p) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
code = tlvDecodeBinary(pTlv, pNode->datum.p);
|
||||
|
|
|
@ -120,7 +120,7 @@ static int32_t callocNodeChunk(SNodeAllocator* pAllocator, SNodeMemChunk** pOutC
|
|||
SNodeMemChunk* pNewChunk = taosMemoryCalloc(1, sizeof(SNodeMemChunk) + pAllocator->chunkSize);
|
||||
if (NULL == pNewChunk) {
|
||||
if (pOutChunk) *pOutChunk = NULL;
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pNewChunk->pBuf = (char*)(pNewChunk + 1);
|
||||
pNewChunk->availableSize = pAllocator->chunkSize;
|
||||
|
@ -141,7 +141,7 @@ static int32_t callocNodeChunk(SNodeAllocator* pAllocator, SNodeMemChunk** pOutC
|
|||
static int32_t nodesCallocImpl(int32_t size, void** pOut) {
|
||||
if (NULL == g_pNodeAllocator) {
|
||||
*pOut = taosMemoryCalloc(1, size);
|
||||
if (!*pOut) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!*pOut) return terrno;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ void nodesFree(void* p) {
|
|||
static int32_t createNodeAllocator(int32_t chunkSize, SNodeAllocator** pAllocator) {
|
||||
*pAllocator = taosMemoryCalloc(1, sizeof(SNodeAllocator));
|
||||
if (NULL == *pAllocator) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(*pAllocator)->chunkSize = chunkSize;
|
||||
int32_t code = callocNodeChunk(*pAllocator, NULL);
|
||||
|
|
|
@ -48,7 +48,7 @@ int32_t qCreateSName(SName* pName, const char* pTableName, int32_t acctId, char*
|
|||
static int32_t smlBoundColumnData(SArray* cols, SBoundColInfo* pBoundInfo, SSchema* pSchema, bool isTag) {
|
||||
bool* pUseCols = taosMemoryCalloc(pBoundInfo->numOfCols, sizeof(bool));
|
||||
if (NULL == pUseCols) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pBoundInfo->numOfBound = 0;
|
||||
|
@ -139,7 +139,7 @@ static int32_t smlBuildTagRow(SArray* cols, SBoundColInfo* tags, SSchema* pSchem
|
|||
int32_t output = 0;
|
||||
void* p = taosMemoryCalloc(1, kv->length * TSDB_NCHAR_SIZE);
|
||||
if (p == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto end;
|
||||
}
|
||||
if (!taosMbsToUcs4(kv->value, kv->length, (TdUcs4*)(p), kv->length * TSDB_NCHAR_SIZE, &output)) {
|
||||
|
@ -240,7 +240,7 @@ int32_t smlBuildCol(STableDataCxt* pTableCxt, SSchema* schema, void* data, int32
|
|||
taosMemoryFree(tmp);
|
||||
} else {
|
||||
uError("SML smlBuildCol out of memory");
|
||||
ret = TSDB_CODE_OUT_OF_MEMORY;
|
||||
ret = terrno;
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ int32_t smlBuildCol(STableDataCxt* pTableCxt, SSchema* schema, void* data, int32
|
|||
}
|
||||
char* pUcs4 = taosMemoryCalloc(1, size);
|
||||
if (NULL == pUcs4) {
|
||||
ret = TSDB_CODE_OUT_OF_MEMORY;
|
||||
ret = terrno;
|
||||
goto end;
|
||||
}
|
||||
if (!taosMbsToUcs4(kv->value, kv->length, (TdUcs4*)pUcs4, size, &len)) {
|
||||
|
@ -315,7 +315,7 @@ int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSc
|
|||
|
||||
pCreateTblReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||
if (NULL == pCreateTblReq) {
|
||||
ret = TSDB_CODE_OUT_OF_MEMORY;
|
||||
ret = terrno;
|
||||
goto end;
|
||||
}
|
||||
insBuildCreateTbReq(pCreateTblReq, tableName, pTag, pTableMeta->suid, NULL, tagName, pTableMeta->tableInfo.numOfTags,
|
||||
|
@ -323,7 +323,7 @@ int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSc
|
|||
|
||||
pCreateTblReq->ctb.stbName = taosMemoryCalloc(1, sTableNameLen + 1);
|
||||
if (pCreateTblReq->ctb.stbName == NULL){
|
||||
ret = TSDB_CODE_OUT_OF_MEMORY;
|
||||
ret = terrno;
|
||||
goto end;
|
||||
}
|
||||
(void)memcpy(pCreateTblReq->ctb.stbName, sTableName, sTableNameLen);
|
||||
|
@ -400,7 +400,7 @@ int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSc
|
|||
int32_t len = 0;
|
||||
char* pUcs4 = taosMemoryCalloc(1, pColSchema->bytes - VARSTR_HEADER_SIZE);
|
||||
if (NULL == pUcs4) {
|
||||
ret = TSDB_CODE_OUT_OF_MEMORY;
|
||||
ret = terrno;
|
||||
goto end;
|
||||
}
|
||||
if (!taosMbsToUcs4(kv->value, kv->length, (TdUcs4*)pUcs4, pColSchema->bytes - VARSTR_HEADER_SIZE, &len)) {
|
||||
|
|
|
@ -182,7 +182,7 @@ static int32_t parseBoundColumns(SInsertParseContext* pCxt, const char** pSql, E
|
|||
|
||||
bool* pUseCols = taosMemoryCalloc(pBoundInfo->numOfCols, sizeof(bool));
|
||||
if (NULL == pUseCols) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pBoundInfo->numOfBound = 0;
|
||||
|
@ -768,7 +768,7 @@ static int32_t buildCreateTbReq(SVnodeModifyOpStmt* pStmt, STag* pTag, SArray* p
|
|||
}
|
||||
pStmt->pCreateTblReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||
if (NULL == pStmt->pCreateTblReq) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
insBuildCreateTbReq(pStmt->pCreateTblReq, pStmt->targetTableName.tname, pTag, pStmt->pTableMeta->suid,
|
||||
pStmt->usingTableName.tname, pTagName, pStmt->pTableMeta->tableInfo.numOfTags,
|
||||
|
@ -850,7 +850,7 @@ static int32_t rewriteTagCondColumnImpl(STagVal* pVal, SNode** pNode) {
|
|||
case TSDB_DATA_TYPE_NCHAR:
|
||||
pValue->datum.p = taosMemoryCalloc(1, pVal->nData + VARSTR_HEADER_SIZE);
|
||||
if (NULL == pValue->datum.p) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
varDataSetLen(pValue->datum.p, pVal->nData);
|
||||
memcpy(varDataVal(pValue->datum.p), pVal->pData, pVal->nData);
|
||||
|
@ -1916,7 +1916,7 @@ static int32_t processCtbAutoCreationAndCtbMeta(SInsertParseContext* pCxt, SVnod
|
|||
|
||||
pStbRowsCxt->pCreateCtbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||
if (pStbRowsCxt->pCreateCtbReq == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
insBuildCreateTbReq(pStbRowsCxt->pCreateCtbReq, pStbRowsCxt->ctbName.tname, pStbRowsCxt->pTag,
|
||||
|
@ -2319,7 +2319,7 @@ static void destroyStbRowsDataContext(SStbRowsDataContext* pStbRowsCxt) {
|
|||
static int32_t constructStbRowsDataContext(SVnodeModifyOpStmt* pStmt, SStbRowsDataContext** ppStbRowsCxt) {
|
||||
SStbRowsDataContext* pStbRowsCxt = taosMemoryCalloc(1, sizeof(SStbRowsDataContext));
|
||||
if (!pStbRowsCxt) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
tNameAssign(&pStbRowsCxt->stbName, &pStmt->targetTableName);
|
||||
int32_t code = collectUseTable(&pStbRowsCxt->stbName, pStmt->pTableNameHashObj);
|
||||
|
|
|
@ -32,7 +32,7 @@ typedef struct SKvParam {
|
|||
int32_t qCloneCurrentTbData(STableDataCxt* pDataBlock, SSubmitTbData** pData) {
|
||||
*pData = taosMemoryCalloc(1, sizeof(SSubmitTbData));
|
||||
if (NULL == *pData) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SSubmitTbData* pNew = *pData;
|
||||
|
@ -190,7 +190,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
|
|||
int32_t output = 0;
|
||||
void* p = taosMemoryCalloc(1, colLen * TSDB_NCHAR_SIZE);
|
||||
if (p == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto end;
|
||||
}
|
||||
if (!taosMbsToUcs4(bind[c].buffer, colLen, (TdUcs4*)(p), colLen * TSDB_NCHAR_SIZE, &output)) {
|
||||
|
@ -224,7 +224,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
|
|||
if (NULL == pDataBlock->pData->pCreateTbReq) {
|
||||
pDataBlock->pData->pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||
if (NULL == pDataBlock->pData->pCreateTbReq) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
@ -465,7 +465,7 @@ int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSc
|
|||
if (fields) {
|
||||
*fields = taosMemoryCalloc(numOfBound, sizeof(TAOS_FIELD_E));
|
||||
if (NULL == *fields) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SSchema* schema = &pSchema[boundColumns[0]];
|
||||
|
@ -572,7 +572,7 @@ int32_t qCloneStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, bool rese
|
|||
|
||||
*pDst = taosMemoryCalloc(1, sizeof(STableDataCxt));
|
||||
if (NULL == *pDst) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
STableDataCxt* pNewCxt = (STableDataCxt*)*pDst;
|
||||
|
@ -650,7 +650,7 @@ int32_t qRebuildStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_
|
|||
if (rebuildCreateTb && NULL == pBlock->pData->pCreateTbReq) {
|
||||
pBlock->pData->pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
|
||||
if (NULL == pBlock->pData->pCreateTbReq) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ int32_t insInitBoundColsInfo(int32_t numOfBound, SBoundColInfo* pInfo) {
|
|||
pInfo->hasBoundCols = false;
|
||||
pInfo->pColIndex = taosMemoryCalloc(numOfBound, sizeof(int16_t));
|
||||
if (NULL == pInfo->pColIndex) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
for (int32_t i = 0; i < numOfBound; ++i) {
|
||||
pInfo->pColIndex[i] = i;
|
||||
|
@ -230,7 +230,7 @@ static int32_t createTableDataCxt(STableMeta* pTableMeta, SVCreateTbReq** pCreat
|
|||
STableDataCxt* pTableCxt = taosMemoryCalloc(1, sizeof(STableDataCxt));
|
||||
if (NULL == pTableCxt) {
|
||||
*pOutput = NULL;
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
|
@ -264,7 +264,7 @@ static int32_t createTableDataCxt(STableMeta* pTableMeta, SVCreateTbReq** pCreat
|
|||
if (TSDB_CODE_SUCCESS == code) {
|
||||
pTableCxt->pData = taosMemoryCalloc(1, sizeof(SSubmitTbData));
|
||||
if (NULL == pTableCxt->pData) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
} else {
|
||||
pTableCxt->pData->flags = (pCreateTbReq != NULL && NULL != *pCreateTbReq) ? SUBMIT_REQ_AUTO_CREATE_TABLE : 0;
|
||||
pTableCxt->pData->flags |= colMode ? SUBMIT_REQ_COLUMN_DATA_FORMAT : 0;
|
||||
|
@ -300,7 +300,7 @@ static int32_t rebuildTableData(SSubmitTbData* pSrc, SSubmitTbData** pDst) {
|
|||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
SSubmitTbData* pTmp = taosMemoryCalloc(1, sizeof(SSubmitTbData));
|
||||
if (NULL == pTmp) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
} else {
|
||||
pTmp->flags = pSrc->flags;
|
||||
pTmp->suid = pSrc->suid;
|
||||
|
@ -477,12 +477,12 @@ static int32_t createVgroupDataCxt(STableDataCxt* pTableCxt, SHashObj* pVgroupHa
|
|||
SVgroupDataCxt** pOutput) {
|
||||
SVgroupDataCxt* pVgCxt = taosMemoryCalloc(1, sizeof(SVgroupDataCxt));
|
||||
if (NULL == pVgCxt) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pVgCxt->pData = taosMemoryCalloc(1, sizeof(SSubmitReq2));
|
||||
if (NULL == pVgCxt->pData) {
|
||||
insDestroyVgroupDataCxt(pVgCxt);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pVgCxt->vgId = pTableCxt->pMeta->vgId;
|
||||
|
@ -840,7 +840,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList,
|
|||
}
|
||||
SVgDataBlocks* dst = taosMemoryCalloc(1, sizeof(SVgDataBlocks));
|
||||
if (NULL == dst) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
dst->numOfTables = taosArrayGetSize(src->pData->aSubmitTbData);
|
||||
|
|
|
@ -2928,7 +2928,7 @@ static int32_t rewriteQueryTimeFunc(STranslateContext* pCxt, int64_t val, SNode*
|
|||
|
||||
char* pStr = taosMemoryCalloc(1, 20);
|
||||
if (NULL == pStr) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
snprintf(pStr, 20, "%" PRId64 "", val);
|
||||
int32_t code = rewriteFuncToValue(pCxt, &pStr, pNode);
|
||||
|
@ -3768,7 +3768,7 @@ static int32_t toVgroupsInfo(SArray* pVgs, SVgroupsInfo** pVgsInfo) {
|
|||
size_t vgroupNum = taosArrayGetSize(pVgs);
|
||||
*pVgsInfo = taosMemoryCalloc(1, sizeof(SVgroupsInfo) + sizeof(SVgroupInfo) * vgroupNum);
|
||||
if (NULL == *pVgsInfo) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(*pVgsInfo)->numOfVgroups = vgroupNum;
|
||||
for (int32_t i = 0; i < vgroupNum; ++i) {
|
||||
|
@ -3797,7 +3797,7 @@ static int32_t dnodeToVgroupsInfo(SArray* pDnodes, SVgroupsInfo** pVgsInfo) {
|
|||
size_t ndnode = taosArrayGetSize(pDnodes);
|
||||
*pVgsInfo = taosMemoryCalloc(1, sizeof(SVgroupsInfo) + sizeof(SVgroupInfo) * ndnode);
|
||||
if (NULL == *pVgsInfo) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(*pVgsInfo)->numOfVgroups = ndnode;
|
||||
for (int32_t i = 0; i < ndnode; ++i) {
|
||||
|
@ -3925,7 +3925,7 @@ static int32_t setSuperTableVgroupList(STranslateContext* pCxt, SName* pName, SR
|
|||
static int32_t setNormalTableVgroupList(STranslateContext* pCxt, SName* pName, SRealTableNode* pRealTable) {
|
||||
pRealTable->pVgroupList = taosMemoryCalloc(1, sizeof(SVgroupsInfo) + sizeof(SVgroupInfo));
|
||||
if (NULL == pRealTable->pVgroupList) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pRealTable->pVgroupList->numOfVgroups = 1;
|
||||
return getTableHashVgroupImpl(pCxt, pName, pRealTable->pVgroupList->vgroups);
|
||||
|
@ -4033,7 +4033,7 @@ static int32_t setTableTsmas(STranslateContext* pCxt, SName* pName, SRealTableNo
|
|||
}
|
||||
SVgroupsInfo* pVgpsInfo = taosMemoryCalloc(1, sizeof(int32_t) + sizeof(SVgroupInfo));
|
||||
if (!pVgpsInfo) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
pVgpsInfo->numOfVgroups = 1;
|
||||
|
@ -6346,7 +6346,7 @@ static int32_t setEqualTbnameTableVgroups(STranslateContext* pCxt, SSelectStmt*
|
|||
const char* pTbName = taosArrayGetP(pInfo->aTbnames, k);
|
||||
char* pNewTbName = taosMemoryCalloc(1, TSDB_TABLE_FNAME_LEN + TSDB_TABLE_NAME_LEN + 1);
|
||||
if (!pNewTbName) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
if (NULL == taosArrayPush(pTbNames, &pNewTbName)) {
|
||||
|
@ -8670,7 +8670,7 @@ static int32_t createRollupTableMeta(SCreateTableStmt* pStmt, int8_t precision,
|
|||
int32_t numOfField = LIST_LENGTH(pStmt->pCols) + LIST_LENGTH(pStmt->pTags);
|
||||
STableMeta* pMeta = taosMemoryCalloc(1, sizeof(STableMeta) + numOfField * sizeof(SSchema));
|
||||
if (NULL == pMeta) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pMeta->tableType = TSDB_SUPER_TABLE;
|
||||
pMeta->tableInfo.numOfTags = LIST_LENGTH(pStmt->pTags);
|
||||
|
@ -9466,7 +9466,7 @@ static int32_t checkCreateSmaIndex(STranslateContext* pCxt, SCreateIndexStmt* pS
|
|||
static int32_t translateCreateSmaIndex(STranslateContext* pCxt, SCreateIndexStmt* pStmt) {
|
||||
int32_t code = checkCreateSmaIndex(pCxt, pStmt);
|
||||
pStmt->pReq = taosMemoryCalloc(1, sizeof(SMCreateSmaReq));
|
||||
if (pStmt->pReq == NULL) code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (pStmt->pReq == NULL) code = terrno;
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = buildCreateSmaReq(pCxt, pStmt, pStmt->pReq);
|
||||
}
|
||||
|
@ -11376,7 +11376,7 @@ static int32_t readFromFile(char* pName, int32_t* len, char** buf) {
|
|||
|
||||
*buf = taosMemoryCalloc(1, *len);
|
||||
if (*buf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
TdFilePtr tfile = taosOpenFile(pName, O_RDONLY | O_BINARY);
|
||||
|
@ -11636,7 +11636,7 @@ static int32_t translateShowVariables(STranslateContext* pCxt, SShowStmt* pStmt)
|
|||
static int32_t translateShowCreateDatabase(STranslateContext* pCxt, SShowCreateDatabaseStmt* pStmt) {
|
||||
pStmt->pCfg = taosMemoryCalloc(1, sizeof(SDbCfgInfo));
|
||||
if (NULL == pStmt->pCfg) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SName name;
|
||||
|
@ -11650,7 +11650,7 @@ static int32_t translateShowCreateDatabase(STranslateContext* pCxt, SShowCreateD
|
|||
static int32_t translateShowCreateTable(STranslateContext* pCxt, SShowCreateTableStmt* pStmt) {
|
||||
pStmt->pDbCfg = taosMemoryCalloc(1, sizeof(SDbCfgInfo));
|
||||
if (NULL == pStmt->pDbCfg) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
int32_t code = getDBCfg(pCxt, pStmt->dbName, (SDbCfgInfo*)pStmt->pDbCfg);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
|
@ -12074,7 +12074,7 @@ static int32_t translateCreateTSMA(STranslateContext* pCxt, SCreateTSMAStmt* pSt
|
|||
SName useTbName = {0};
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
pStmt->pReq = taosMemoryCalloc(1, sizeof(SMCreateSmaReq));
|
||||
if (!pStmt->pReq) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pStmt->pReq) return terrno;
|
||||
}
|
||||
if (code == TSDB_CODE_SUCCESS) {
|
||||
code = buildCreateTSMAReq(pCxt, pStmt, pStmt->pReq, &useTbName);
|
||||
|
@ -12382,7 +12382,7 @@ static int32_t extractQueryResultSchema(const SNodeList* pProjections, int32_t*
|
|||
*numOfCols = LIST_LENGTH(pProjections);
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
SNode* pNode;
|
||||
|
@ -12414,7 +12414,7 @@ static int32_t extractExplainResultSchema(int32_t* numOfCols, SSchema** pSchema)
|
|||
*numOfCols = 1;
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(*pSchema)[0].type = TSDB_DATA_TYPE_BINARY;
|
||||
(*pSchema)[0].bytes = TSDB_EXPLAIN_RESULT_ROW_SIZE;
|
||||
|
@ -12427,7 +12427,7 @@ static int32_t extractDescribeResultSchema(STableMeta* pMeta, int32_t* numOfCols
|
|||
if (pMeta && useCompress(pMeta->tableType)) *numOfCols = DESCRIBE_RESULT_COLS_COMPRESS;
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(*pSchema)[0].type = TSDB_DATA_TYPE_BINARY;
|
||||
|
@ -12467,7 +12467,7 @@ static int32_t extractShowCreateDatabaseResultSchema(int32_t* numOfCols, SSchema
|
|||
*numOfCols = 2;
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(*pSchema)[0].type = TSDB_DATA_TYPE_BINARY;
|
||||
|
@ -12485,7 +12485,7 @@ static int32_t extractShowCreateTableResultSchema(int32_t* numOfCols, SSchema**
|
|||
*numOfCols = 2;
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(*pSchema)[0].type = TSDB_DATA_TYPE_BINARY;
|
||||
|
@ -12503,7 +12503,7 @@ static int32_t extractShowCreateViewResultSchema(int32_t* numOfCols, SSchema** p
|
|||
*numOfCols = SHOW_CREATE_VIEW_RESULT_COLS;
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(*pSchema)[0].type = TSDB_DATA_TYPE_BINARY;
|
||||
|
@ -12521,7 +12521,7 @@ static int32_t extractShowVariablesResultSchema(int32_t* numOfCols, SSchema** pS
|
|||
*numOfCols = 3;
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(*pSchema)[0].type = TSDB_DATA_TYPE_BINARY;
|
||||
|
@ -12543,7 +12543,7 @@ static int32_t extractCompactDbResultSchema(int32_t* numOfCols, SSchema** pSchem
|
|||
*numOfCols = COMPACT_DB_RESULT_COLS;
|
||||
*pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema));
|
||||
if (NULL == (*pSchema)) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
(*pSchema)[0].type = TSDB_DATA_TYPE_BINARY;
|
||||
|
@ -13269,7 +13269,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
|
|||
req.ntb.schemaRow.pSchema = taosMemoryCalloc(req.ntb.schemaRow.nCols, sizeof(SSchema));
|
||||
if (NULL == req.name || NULL == req.ntb.schemaRow.pSchema) {
|
||||
tdDestroySVCreateTbReq(&req);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
if (pStmt->ignoreExists) {
|
||||
req.flags |= TD_CREATE_IF_NOT_EXISTS;
|
||||
|
@ -13346,7 +13346,7 @@ static int32_t serializeVgroupCreateTableBatch(SVgroupCreateTableBatch* pTbBatch
|
|||
SVgDataBlocks* pVgData = taosMemoryCalloc(1, sizeof(SVgDataBlocks));
|
||||
if (NULL == pVgData) {
|
||||
taosMemoryFreeClear(buf);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pVgData->vg = pTbBatch->info;
|
||||
pVgData->pData = buf;
|
||||
|
@ -14069,7 +14069,7 @@ static int32_t prepareReadCsvFile(STranslateContext* pCxt, SCreateSubTableFromFi
|
|||
{
|
||||
pCreateInfo = taosMemoryCalloc(1, sizeof(SCreateTbInfo));
|
||||
if (NULL == pCreateInfo) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _ERR;
|
||||
}
|
||||
|
||||
|
@ -14379,7 +14379,7 @@ static int32_t serializeVgroupDropTableBatch(SVgroupDropTableBatch* pTbBatch, SA
|
|||
SVgDataBlocks* pVgData = taosMemoryCalloc(1, sizeof(SVgDataBlocks));
|
||||
if (NULL == pVgData) {
|
||||
taosMemoryFreeClear(buf);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pVgData->vg = pTbBatch->info;
|
||||
pVgData->pData = buf;
|
||||
|
@ -14829,7 +14829,7 @@ static int32_t serializeAlterTbReq(STranslateContext* pCxt, SAlterTableStmt* pSt
|
|||
SVgDataBlocks* pVgData = taosMemoryCalloc(1, sizeof(SVgDataBlocks));
|
||||
if (NULL == pVgData) {
|
||||
taosMemoryFree(pMsg);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pVgData->vg = vg;
|
||||
pVgData->pData = pMsg;
|
||||
|
@ -14934,7 +14934,7 @@ static int32_t serializeFlushVgroup(SVgroupInfo* pVg, SArray* pBufArray) {
|
|||
SVgDataBlocks* pVgData = taosMemoryCalloc(1, sizeof(SVgDataBlocks));
|
||||
if (NULL == pVgData) {
|
||||
taosMemoryFree(buf);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
pVgData->vg = *pVg;
|
||||
pVgData->pData = buf;
|
||||
|
|
|
@ -463,7 +463,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, voi
|
|||
int32_t valLen = (int32_t)strlen(jsonValue);
|
||||
char* tmp = taosMemoryCalloc(1, valLen * TSDB_NCHAR_SIZE);
|
||||
if (!tmp) {
|
||||
retCode = TSDB_CODE_OUT_OF_MEMORY;
|
||||
retCode = terrno;
|
||||
goto end;
|
||||
}
|
||||
val.type = TSDB_DATA_TYPE_NCHAR;
|
||||
|
@ -1039,7 +1039,7 @@ int32_t getTableMetaFromCache(SParseMetaCache* pMetaCache, const SName* pName, S
|
|||
int32_t buildTableMetaFromViewMeta(STableMeta** pMeta, SViewMeta* pViewMeta) {
|
||||
*pMeta = taosMemoryCalloc(1, sizeof(STableMeta) + pViewMeta->numOfCols * sizeof(SSchema));
|
||||
if (NULL == *pMeta) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(*pMeta)->uid = pViewMeta->viewId;
|
||||
(*pMeta)->vgId = MNODE_HANDLE;
|
||||
|
|
|
@ -172,7 +172,7 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) {
|
|||
case TSDB_DATA_TYPE_VARBINARY:
|
||||
pVal->datum.p = taosMemoryCalloc(1, pVal->node.resType.bytes + VARSTR_HEADER_SIZE + 1);
|
||||
if (NULL == pVal->datum.p) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
varDataSetLen(pVal->datum.p, pVal->node.resType.bytes);
|
||||
memcpy(varDataVal(pVal->datum.p), pParam->buffer, pVal->node.resType.bytes);
|
||||
|
@ -182,7 +182,7 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) {
|
|||
case TSDB_DATA_TYPE_GEOMETRY:
|
||||
pVal->datum.p = taosMemoryCalloc(1, pVal->node.resType.bytes + VARSTR_HEADER_SIZE + 1);
|
||||
if (NULL == pVal->datum.p) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
varDataSetLen(pVal->datum.p, pVal->node.resType.bytes);
|
||||
strncpy(varDataVal(pVal->datum.p), (const char*)pParam->buffer, pVal->node.resType.bytes);
|
||||
|
@ -192,7 +192,7 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) {
|
|||
pVal->node.resType.bytes *= TSDB_NCHAR_SIZE;
|
||||
pVal->datum.p = taosMemoryCalloc(1, pVal->node.resType.bytes + VARSTR_HEADER_SIZE + 1);
|
||||
if (NULL == pVal->datum.p) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t output = 0;
|
||||
|
|
Loading…
Reference in New Issue