Merge pull request #27673 from taosdata/enh/TD-31902
enh:[TD-31902] Remove void.
This commit is contained in:
commit
9150c0b07e
|
@ -687,7 +687,9 @@ void doDestroyRequest(void *p) {
|
|||
taosMemoryFreeClear(pRequest->msgBuf);
|
||||
|
||||
doFreeReqResultInfo(&pRequest->body.resInfo);
|
||||
(void)tsem_destroy(&pRequest->body.rspSem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_destroy(&pRequest->body.rspSem)) {
|
||||
tscError("failed to destroy semaphore");
|
||||
}
|
||||
|
||||
taosArrayDestroy(pRequest->tableList);
|
||||
taosArrayDestroy(pRequest->targetTableList);
|
||||
|
@ -700,7 +702,9 @@ void doDestroyRequest(void *p) {
|
|||
taosMemoryFreeClear(pRequest->pDb);
|
||||
taosArrayDestroy(pRequest->dbList);
|
||||
if (pRequest->body.interParam) {
|
||||
(void)tsem_destroy(&((SSyncQueryParam *)pRequest->body.interParam)->sem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_destroy(&((SSyncQueryParam *)pRequest->body.interParam)->sem)) {
|
||||
tscError("failed to destroy semaphore in pRequest");
|
||||
}
|
||||
}
|
||||
taosMemoryFree(pRequest->body.interParam);
|
||||
|
||||
|
|
|
@ -1636,7 +1636,9 @@ void hbDeregisterConn(STscObj *pTscObj, SClientHbKey connKey) {
|
|||
SClientHbReq *pReq = taosHashAcquire(pAppHbMgr->activeInfo, &connKey, sizeof(SClientHbKey));
|
||||
if (pReq) {
|
||||
tFreeClientHbReq(pReq);
|
||||
(void)taosHashRemove(pAppHbMgr->activeInfo, &connKey, sizeof(SClientHbKey));
|
||||
if (TSDB_CODE_SUCCESS != taosHashRemove(pAppHbMgr->activeInfo, &connKey, sizeof(SClientHbKey))) {
|
||||
tscError("failed to remove connKey from activeInfo");
|
||||
}
|
||||
taosHashRelease(pAppHbMgr->activeInfo, pReq);
|
||||
(void)atomic_sub_fetch_32(&pAppHbMgr->connKeyCnt, 1);
|
||||
}
|
||||
|
|
|
@ -209,7 +209,9 @@ _return:
|
|||
|
||||
void freeQueryParam(SSyncQueryParam* param) {
|
||||
if (param == NULL) return;
|
||||
(void)tsem_destroy(¶m->sem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_destroy(¶m->sem)) {
|
||||
tscError("failed to destroy semaphore in freeQueryParam");
|
||||
}
|
||||
taosMemoryFree(param);
|
||||
}
|
||||
|
||||
|
@ -351,7 +353,7 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) {
|
|||
|
||||
// int64_t transporterId = 0;
|
||||
TSC_ERR_RET(asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &pMsgInfo->epSet, NULL, pSendMsg));
|
||||
(void)tsem_wait(&pRequest->body.rspSem);
|
||||
TSC_ERR_RET(tsem_wait(&pRequest->body.rspSem));
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1165,14 +1167,18 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
|
|||
if (code != TSDB_CODE_SUCCESS && NEED_CLIENT_HANDLE_ERROR(code) && pRequest->sqlstr != NULL) {
|
||||
tscDebug("0x%" PRIx64 " client retry to handle the error, code:%s, tryCount:%d,QID:0x%" PRIx64, pRequest->self,
|
||||
tstrerror(code), pRequest->retry, pRequest->requestId);
|
||||
(void)removeMeta(pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type));
|
||||
if (TSDB_CODE_SUCCESS != removeMeta(pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type))) {
|
||||
tscError("0x%" PRIx64 " remove meta failed,QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
}
|
||||
restartAsyncQuery(pRequest, code);
|
||||
return;
|
||||
}
|
||||
|
||||
tscDebug("schedulerExecCb request type %s", TMSG_INFO(pRequest->type));
|
||||
if (NEED_CLIENT_RM_TBLMETA_REQ(pRequest->type) && NULL == pRequest->body.resInfo.execRes.res) {
|
||||
(void)removeMeta(pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type));
|
||||
if (TSDB_CODE_SUCCESS != removeMeta(pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type))) {
|
||||
tscError("0x%" PRIx64 " remove meta failed,QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
}
|
||||
}
|
||||
|
||||
pRequest->metric.execCostUs = taosGetTimestampUs() - pRequest->metric.execStart;
|
||||
|
@ -1266,7 +1272,10 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue
|
|||
}
|
||||
|
||||
if (NEED_CLIENT_RM_TBLMETA_REQ(pRequest->type) && NULL == pRequest->body.resInfo.execRes.res) {
|
||||
(void)removeMeta(pRequest->pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type));
|
||||
code = removeMeta(pRequest->pTscObj, pRequest->targetTableList, IS_VIEW_REQUEST(pRequest->type));
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscError("0x%" PRIx64 " remove meta failed,QID:0x%" PRIx64, pRequest->self, pRequest->requestId);
|
||||
}
|
||||
}
|
||||
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
|
@ -1479,12 +1488,12 @@ int32_t removeMeta(STscObj* pTscObj, SArray* tbList, bool isView) {
|
|||
continue;
|
||||
}
|
||||
(void)tNameGetFullDbName(pViewName, dbFName);
|
||||
(void)catalogRemoveViewMeta(pCatalog, dbFName, 0, pViewName->tname, 0);
|
||||
TSC_ERR_RET(catalogRemoveViewMeta(pCatalog, dbFName, 0, pViewName->tname, 0));
|
||||
}
|
||||
} else {
|
||||
for (int32_t i = 0; i < tbNum; ++i) {
|
||||
SName* pTbName = taosArrayGet(tbList, i);
|
||||
(void)catalogRemoveTableMeta(pCatalog, pTbName);
|
||||
TSC_ERR_RET(catalogRemoveTableMeta(pCatalog, pTbName));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1584,7 +1593,11 @@ int32_t taosConnectImpl(const char* user, const char* auth, const char* db, __ta
|
|||
tscError("failed to send connect msg to server, code:%s", tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
(void)tsem_wait(&pRequest->body.rspSem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_wait(&pRequest->body.rspSem)) {
|
||||
destroyTscObj(*pTscObj);
|
||||
tscError("failed to wait sem, code:%s", terrstr());
|
||||
return terrno;
|
||||
}
|
||||
if (pRequest->code != TSDB_CODE_SUCCESS) {
|
||||
const char* errorMsg = (code == TSDB_CODE_RPC_FQDN_ERROR) ? taos_errstr(pRequest) : tstrerror(pRequest->code);
|
||||
tscError("failed to connect to server, reason: %s", errorMsg);
|
||||
|
@ -1736,7 +1749,9 @@ int32_t doProcessMsgFromServer(void* param) {
|
|||
tscError("doProcessMsgFromServer pRequest->self:%" PRId64 " != pSendInfo->requestObjRefId:%" PRId64,
|
||||
pRequest->self, pSendInfo->requestObjRefId);
|
||||
|
||||
(void)taosReleaseRef(clientReqRefPool, pSendInfo->requestObjRefId);
|
||||
if (TSDB_CODE_SUCCESS != taosReleaseRef(clientReqRefPool, pSendInfo->requestObjRefId)) {
|
||||
tscError("doProcessMsgFromServer taosReleaseRef failed");
|
||||
}
|
||||
taosMemoryFree(arg->pEpset);
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
destroySendMsgInfo(pSendInfo);
|
||||
|
@ -1769,7 +1784,12 @@ int32_t doProcessMsgFromServer(void* param) {
|
|||
(void)pSendInfo->fp(pSendInfo->param, &buf, pMsg->code);
|
||||
|
||||
if (pTscObj) {
|
||||
(void)taosReleaseRef(clientReqRefPool, pSendInfo->requestObjRefId);
|
||||
int32_t code = taosReleaseRef(clientReqRefPool, pSendInfo->requestObjRefId);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscError("doProcessMsgFromServer taosReleaseRef failed");
|
||||
terrno = code;
|
||||
pMsg->code = code;
|
||||
}
|
||||
}
|
||||
|
||||
rpcFreeCont(pMsg->pCont);
|
||||
|
@ -1946,7 +1966,9 @@ void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4)
|
|||
|
||||
static void syncFetchFn(void* param, TAOS_RES* res, int32_t numOfRows) {
|
||||
tsem_t* sem = param;
|
||||
(void)tsem_post(sem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_post(sem)) {
|
||||
tscError("failed to post sem, code:%s", terrstr());
|
||||
}
|
||||
}
|
||||
|
||||
void* doAsyncFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4) {
|
||||
|
@ -1965,10 +1987,16 @@ void* doAsyncFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertU
|
|||
// convert ucs4 to native multi-bytes string
|
||||
pResultInfo->convertUcs4 = convertUcs4;
|
||||
tsem_t sem;
|
||||
(void)tsem_init(&sem, 0, 0);
|
||||
if (TSDB_CODE_SUCCESS != tsem_init(&sem, 0, 0)) {
|
||||
tscError("failed to init sem, code:%s", terrstr());
|
||||
}
|
||||
taos_fetch_rows_a(pRequest, syncFetchFn, &sem);
|
||||
(void)tsem_wait(&sem);
|
||||
(void)tsem_destroy(&sem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_wait(&sem)) {
|
||||
tscError("failed to wait sem, code:%s", terrstr());
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS != tsem_destroy(&sem)) {
|
||||
tscError("failed to destroy sem, code:%s", terrstr());
|
||||
}
|
||||
pRequest->inCallback = false;
|
||||
}
|
||||
|
||||
|
@ -2742,7 +2770,9 @@ void syncCatalogFn(SMetaData* pResult, void* param, int32_t code) {
|
|||
SSyncQueryParam* pParam = param;
|
||||
pParam->pRequest->code = code;
|
||||
|
||||
(void)tsem_post(&pParam->sem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_post(&pParam->sem)) {
|
||||
tscError("failed to post semaphore since %s", tstrerror(terrno));
|
||||
}
|
||||
}
|
||||
|
||||
void syncQueryFn(void* param, void* res, int32_t code) {
|
||||
|
@ -2753,7 +2783,9 @@ void syncQueryFn(void* param, void* res, int32_t code) {
|
|||
pParam->pRequest->code = code;
|
||||
}
|
||||
|
||||
(void)tsem_post(&pParam->sem);
|
||||
if (TSDB_CODE_SUCCESS != tsem_post(&pParam->sem)) {
|
||||
tscError("failed to post semaphore since %s", tstrerror(terrno));
|
||||
}
|
||||
}
|
||||
|
||||
void taosAsyncQueryImpl(uint64_t connId, const char* sql, __taos_async_fn_t fp, void* param, bool validateOnly,
|
||||
|
@ -2831,10 +2863,20 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly, int8_t s
|
|||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return NULL;
|
||||
}
|
||||
(void)tsem_init(¶m->sem, 0, 0);
|
||||
int32_t code = tsem_init(¶m->sem, 0, 0);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
terrno = code;
|
||||
taosMemoryFree(param);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
taosAsyncQueryImpl(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly, source);
|
||||
(void)tsem_wait(¶m->sem);
|
||||
code = tsem_wait(¶m->sem);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
terrno = code;
|
||||
taosMemoryFree(param);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SRequestObj* pRequest = NULL;
|
||||
if (param->pRequest != NULL) {
|
||||
|
@ -2860,10 +2902,20 @@ TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly,
|
|||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return NULL;
|
||||
}
|
||||
(void)tsem_init(¶m->sem, 0, 0);
|
||||
int32_t code = tsem_init(¶m->sem, 0, 0);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
terrno = code;
|
||||
taosMemoryFree(param);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
taosAsyncQueryImplWithReqid(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly, reqid);
|
||||
(void)tsem_wait(¶m->sem);
|
||||
code = tsem_wait(¶m->sem);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
terrno = code;
|
||||
taosMemoryFree(param);
|
||||
return NULL;
|
||||
}
|
||||
SRequestObj* pRequest = NULL;
|
||||
if (param->pRequest != NULL) {
|
||||
param->pRequest->syncQuery = true;
|
||||
|
|
|
@ -312,7 +312,9 @@ void taos_close_internal(void *taos) {
|
|||
STscObj *pTscObj = (STscObj *)taos;
|
||||
tscDebug("0x%" PRIx64 " try to close connection, numOfReq:%d", pTscObj->id, pTscObj->numOfReqs);
|
||||
|
||||
(void)taosRemoveRef(clientConnRefPool, pTscObj->id);
|
||||
if (TSDB_CODE_SUCCESS != taosRemoveRef(clientConnRefPool, pTscObj->id)) {
|
||||
tscError("0x%" PRIx64 " failed to remove ref from conn pool", pTscObj->id);
|
||||
}
|
||||
}
|
||||
|
||||
void taos_close(TAOS *taos) {
|
||||
|
@ -1313,7 +1315,10 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
|
|||
if (NEED_CLIENT_HANDLE_ERROR(code)) {
|
||||
tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d,QID:0x%" PRIx64,
|
||||
pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId);
|
||||
(void)refreshMeta(pRequest->pTscObj, pRequest); // ignore return code,try again
|
||||
if (TSDB_CODE_SUCCESS != refreshMeta(pRequest->pTscObj, pRequest)) {
|
||||
tscWarn("0x%" PRIx64 " refresh meta failed, code:%d - %s,QID:0x%" PRIx64, pRequest->self, code,
|
||||
tstrerror(code), pRequest->requestId);
|
||||
}
|
||||
pRequest->prevCode = code;
|
||||
doAsyncQuery(pRequest, true);
|
||||
return;
|
||||
|
@ -1614,8 +1619,11 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
|
|||
}
|
||||
|
||||
SSyncQueryParam *pParam = pRequest->body.interParam;
|
||||
(void)tsem_wait(&pParam->sem);
|
||||
|
||||
code = tsem_wait(&pParam->sem);
|
||||
if (code) {
|
||||
tscError("tsem wait failed, code:%d - %s", code, tstrerror(code));
|
||||
goto _return;
|
||||
}
|
||||
_return:
|
||||
destoryCatalogReq(&catalogReq);
|
||||
destroyRequest(pRequest);
|
||||
|
|
|
@ -396,15 +396,21 @@ int32_t vnodeGetBatchMeta(SVnode *pVnode, SRpcMsg *pMsg) {
|
|||
switch (req->msgType) {
|
||||
case TDMT_VND_TABLE_META:
|
||||
// error code has been set into reqMsg, no need to handle it here.
|
||||
(void)vnodeGetTableMeta(pVnode, &reqMsg, false);
|
||||
if (TSDB_CODE_SUCCESS != vnodeGetTableMeta(pVnode, &reqMsg, false)) {
|
||||
qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
|
||||
}
|
||||
break;
|
||||
case TDMT_VND_TABLE_CFG:
|
||||
// error code has been set into reqMsg, no need to handle it here.
|
||||
(void)vnodeGetTableCfg(pVnode, &reqMsg, false);
|
||||
if (TSDB_CODE_SUCCESS != vnodeGetTableCfg(pVnode, &reqMsg, false)) {
|
||||
qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
|
||||
}
|
||||
break;
|
||||
case TDMT_VND_GET_STREAM_PROGRESS:
|
||||
// error code has been set into reqMsg, no need to handle it here.
|
||||
(void)vnodeGetStreamProgress(pVnode, &reqMsg, false);
|
||||
if (TSDB_CODE_SUCCESS != vnodeGetStreamProgress(pVnode, &reqMsg, false)) {
|
||||
qWarn("vnodeGetBatchMeta failed, msgType:%d", req->msgType);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
qError("invalid req msgType %d", req->msgType);
|
||||
|
|
|
@ -431,7 +431,9 @@ static int32_t createPartialFunction(const SFunctionNode* pSrcFunc, SFunctionNod
|
|||
(*pPartialFunc)->originalFuncId = pSrcFunc->hasOriginalFunc ? pSrcFunc->originalFuncId : pSrcFunc->funcId;
|
||||
char name[TSDB_FUNC_NAME_LEN + TSDB_NAME_DELIMITER_LEN + TSDB_POINTER_PRINT_BYTES + 1] = {0};
|
||||
int32_t len = snprintf(name, sizeof(name) - 1, "%s.%p", (*pPartialFunc)->functionName, pSrcFunc);
|
||||
(void)taosHashBinary(name, len);
|
||||
if (taosHashBinary(name, len) < 0) {
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
(void)strncpy((*pPartialFunc)->node.aliasName, name, TSDB_COL_NAME_LEN - 1);
|
||||
(*pPartialFunc)->hasPk = pSrcFunc->hasPk;
|
||||
(*pPartialFunc)->pkBytes = pSrcFunc->pkBytes;
|
||||
|
|
|
@ -2249,7 +2249,7 @@ int32_t fltInitValFieldData(SFilterInfo *info) {
|
|||
return TSDB_CODE_SCALAR_CONVERT_ERROR;
|
||||
}
|
||||
varDataSetLen(newValData, len);
|
||||
(void)varDataCopy(fi->data, newValData);
|
||||
varDataCopy(fi->data, newValData);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4592,7 +4592,7 @@ int32_t filterConverNcharColumns(SFilterInfo *info, int32_t rows, bool *gotNchar
|
|||
if (k == varSrcLen) {
|
||||
/* NULL */
|
||||
varDataLen(dst) = (VarDataLenT)varSrcLen;
|
||||
(void)varDataCopy(dst, src);
|
||||
varDataCopy(dst, src);
|
||||
continue;
|
||||
}
|
||||
bool ret = taosMbsToUcs4(varDataVal(src), varDataLen(src), (TdUcs4 *)varDataVal(dst), bufSize, &len);
|
||||
|
|
|
@ -1585,7 +1585,10 @@ EDealRes sclWalkTarget(SNode *pNode, SScalarCtx *ctx) {
|
|||
block->info.rows = res->numOfRows;
|
||||
|
||||
sclFreeParam(res);
|
||||
(void)taosHashRemove(ctx->pRes, (void *)&target->pExpr, POINTER_BYTES);
|
||||
ctx->code = taosHashRemove(ctx->pRes, (void *)&target->pExpr, POINTER_BYTES);
|
||||
if (TSDB_CODE_SUCCESS != ctx->code) {
|
||||
return DEAL_RES_ERROR;
|
||||
}
|
||||
return DEAL_RES_CONTINUE;
|
||||
}
|
||||
|
||||
|
@ -1811,7 +1814,7 @@ int32_t scalarCalculate(SNode *pNode, SArray *pBlockList, SScalarParam *pDst) {
|
|||
}
|
||||
|
||||
sclFreeParam(res);
|
||||
(void)taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES);
|
||||
SCL_ERR_JRET(taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES));
|
||||
}
|
||||
|
||||
_return:
|
||||
|
|
|
@ -76,7 +76,7 @@ int32_t flttMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
|
|||
if (NULL == vnode->datum.p) {
|
||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
}
|
||||
(void)varDataCopy(vnode->datum.p, value);
|
||||
varDataCopy(vnode->datum.p, value);
|
||||
vnode->node.resType.bytes = varDataLen(value);
|
||||
} else {
|
||||
vnode->node.resType.bytes = tDataTypes[dataType].bytes;
|
||||
|
|
|
@ -120,7 +120,9 @@ int32_t scltAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t
|
|||
SCL_ERR_RET(TSDB_CODE_APP_ERROR);
|
||||
}
|
||||
|
||||
(void)taosArrayPush(pBlockList, &res);
|
||||
if (NULL == taosArrayPush(pBlockList, &res)) {
|
||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
}
|
||||
*dataBlockId = taosArrayGetSize(pBlockList) - 1;
|
||||
res->info.id.blockId = *dataBlockId;
|
||||
*slotId = 0;
|
||||
|
@ -161,7 +163,7 @@ int32_t scltMakeValueNode(SNode **pNode, int32_t dataType, void *value) {
|
|||
if (NULL == vnode->datum.p) {
|
||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
}
|
||||
(void)varDataCopy(vnode->datum.p, value);
|
||||
varDataCopy(vnode->datum.p, value);
|
||||
vnode->node.resType.bytes = varDataTLen(value);
|
||||
} else {
|
||||
vnode->node.resType.bytes = tDataTypes[dataType].bytes;
|
||||
|
@ -1382,7 +1384,9 @@ int32_t makeCalculate(void *json, void *key, int32_t rightType, void *rightData,
|
|||
SNode *opNode = NULL;
|
||||
|
||||
SCL_ERR_RET(makeJsonArrow(&src, &opNode, json, (char *)key));
|
||||
(void)taosArrayPush(blockList, &src);
|
||||
if (NULL == taosArrayPush(blockList, &src)) {
|
||||
SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
SCL_ERR_RET(makeOperator(&opNode, blockList, opType, rightType, rightData, isReverse));
|
||||
|
||||
|
@ -1909,7 +1913,7 @@ TEST(columnTest, bigint_column_multi_binary_column) {
|
|||
|
||||
SArray *blockList = taosArrayInit(1, POINTER_BYTES);
|
||||
ASSERT_NE(blockList, nullptr);
|
||||
(void)taosArrayPush(blockList, &src);
|
||||
ASSERT_NE(taosArrayPush(blockList, &src), nullptr);
|
||||
|
||||
SColumnInfo colInfo = createColumnInfo(1, TSDB_DATA_TYPE_DOUBLE, sizeof(double));
|
||||
int16_t dataBlockId = 0, slotId = 0;
|
||||
|
|
|
@ -1227,7 +1227,11 @@ static void checkRegexCache(void* param, void* tmrId) {
|
|||
if(sRegexCache.exit) {
|
||||
goto _exit;
|
||||
}
|
||||
(void)taosTmrReset(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, param, sRegexCache.regexCacheTmr, &tmrId);
|
||||
bool ret = taosTmrReset(checkRegexCache, REGEX_CACHE_CLEAR_TIME * 1000, param, sRegexCache.regexCacheTmr, &tmrId);
|
||||
if (!ret) {
|
||||
uError("failed to reset regex cache timer");
|
||||
goto _exit;
|
||||
}
|
||||
if (taosHashGetSize(sRegexCache.regexHash) < MAX_REGEX_CACHE_SIZE) {
|
||||
goto _exit;
|
||||
}
|
||||
|
@ -1238,7 +1242,10 @@ static void checkRegexCache(void* param, void* tmrId) {
|
|||
if (taosGetTimestampSec() - (*ppUsingRegex)->lastUsedTime > REGEX_CACHE_CLEAR_TIME) {
|
||||
size_t len = 0;
|
||||
char* key = (char*)taosHashGetKey(ppUsingRegex, &len);
|
||||
(void)taosHashRemove(sRegexCache.regexHash, key, len);
|
||||
if (TSDB_CODE_SUCCESS != taosHashRemove(sRegexCache.regexHash, key, len)) {
|
||||
uError("failed to remove regex pattern %s from cache", key);
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
ppUsingRegex = taosHashIterate(sRegexCache.regexHash, ppUsingRegex);
|
||||
}
|
||||
|
@ -1285,7 +1292,10 @@ void DestroyRegexCache(){
|
|||
#endif
|
||||
int32_t code = 0;
|
||||
uInfo("[regex cache] destory regex cache");
|
||||
(void)taosTmrStopA(&sRegexCache.timer);
|
||||
bool ret = taosTmrStopA(&sRegexCache.timer);
|
||||
if (!ret) {
|
||||
uError("failed to stop regex cache timer");
|
||||
}
|
||||
taosWLockLatch(&sRegexCache.mutex);
|
||||
sRegexCache.exit = true;
|
||||
taosHashCleanup(sRegexCache.regexHash);
|
||||
|
|
Loading…
Reference in New Issue