From 7cb5c2ef014248f516d60e7c79abf2f7d28953a2 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sun, 28 Jul 2024 01:29:13 +0800 Subject: [PATCH] fix:[TD-31017]process return value in client --- source/client/src/clientJniConnector.c | 2 +- source/client/src/clientMonitor.c | 4 ++-- source/client/src/clientMsgHandler.c | 8 ++++---- source/client/src/clientStmt.c | 14 +++++++------- source/client/src/clientTmq.c | 2 +- source/client/src/clientTmqConnector.c | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/client/src/clientJniConnector.c b/source/client/src/clientJniConnector.c index 4a200179f9..d783c6d8e4 100644 --- a/source/client/src/clientJniConnector.c +++ b/source/client/src/clientJniConnector.c @@ -484,7 +484,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData (*env)->SetIntField(env, metadataObj, g_metadataColindexField, i); jstring metadataObjColname = (*env)->NewStringUTF(env, fields[i].name); (*env)->SetObjectField(env, metadataObj, g_metadataColnameField, metadataObjColname); - (*env)->CallBooleanMethod(env, arrayListObj, g_arrayListAddFp, metadataObj); + (void)(*env)->CallBooleanMethod(env, arrayListObj, g_arrayListAddFp, metadataObj); } } diff --git a/source/client/src/clientMonitor.c b/source/client/src/clientMonitor.c index d47b074658..40cea644fd 100644 --- a/source/client/src/clientMonitor.c +++ b/source/client/src/clientMonitor.c @@ -248,7 +248,7 @@ void monitorCreateClient(int64_t clusterId) { goto fail; } - taos_collector_registry_register_collector(pMonitor->registry, pMonitor->colector); + (void)taos_collector_registry_register_collector(pMonitor->registry, pMonitor->colector); pMonitor->counters = (SHashObj*)taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK); if (pMonitor->counters == NULL) { @@ -772,7 +772,7 @@ static int32_t tscMonitortInit() { return TSDB_CODE_TSC_INTERNAL_ERROR; } - taosThreadAttrDestroy(&thAttr); + (void)taosThreadAttrDestroy(&thAttr); return 0; } diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c index dd8cf87c74..9a6945b021 100644 --- a/source/client/src/clientMsgHandler.c +++ b/source/client/src/clientMsgHandler.c @@ -164,18 +164,18 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { } } - taosThreadMutexLock(&clientHbMgr.lock); + (void)taosThreadMutexLock(&clientHbMgr.lock); SAppHbMgr* pAppHbMgr = taosArrayGetP(clientHbMgr.appHbMgrs, pTscObj->appHbMgrIdx); if (pAppHbMgr) { (void)hbRegisterConn(pAppHbMgr, pTscObj->id, connectRsp.clusterId, connectRsp.connType); } else { - taosThreadMutexUnlock(&clientHbMgr.lock); + (void)taosThreadMutexUnlock(&clientHbMgr.lock); code = TSDB_CODE_TSC_DISCONNECTED; setErrno(pRequest, code); (void)tsem_post(&pRequest->body.rspSem); goto End; } - taosThreadMutexUnlock(&clientHbMgr.lock); + (void)taosThreadMutexUnlock(&clientHbMgr.lock); tscDebug("0x%" PRIx64 " clusterId:%" PRId64 ", totalConn:%" PRId64, pRequest->requestId, connectRsp.clusterId, pTscObj->pAppInfo->numOfConns); @@ -184,7 +184,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { End: if (pRequest) { - releaseRequest(pRequest->self); + (void)releaseRequest(pRequest->self); } taosMemoryFree(param); diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c index 11c27b409d..821dffce86 100644 --- a/source/client/src/clientStmt.c +++ b/source/client/src/clientStmt.c @@ -450,7 +450,7 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) { } qDestroyStmtDataBlock(pBlocks); - taosHashRemove(pStmt->exec.pBlockHash, key, keyLen); + STMT_ERR_RET(taosHashRemove(pStmt->exec.pBlockHash, key, keyLen)); pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter); } @@ -640,7 +640,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) { if (TSDB_CODE_PAR_TABLE_NOT_EXIST == code) { tscDebug("tb %s not exist", pStmt->bInfo.tbFName); - stmtCleanBindInfo(pStmt); + STMT_ERR_RET(stmtCleanBindInfo(pStmt)); STMT_ERR_RET(code); } @@ -991,7 +991,7 @@ int stmtSetTbName(TAOS_STMT* stmt, const char* tbName) { STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_SETTBNAME)); int32_t insert = 0; - stmtIsInsert(stmt, &insert); + STMT_ERR_RET(stmtIsInsert(stmt, &insert)); if (0 == insert) { tscError("set tb name not available for none insert statement"); STMT_ERR_RET(TSDB_CODE_TSC_STMT_API_ERROR); @@ -1161,7 +1161,7 @@ int32_t stmtAppendTablePostHandle(STscStmt* pStmt, SStmtQNode* param) { } if (0 == pStmt->sql.siInfo.firstName[0]) { - strcpy(pStmt->sql.siInfo.firstName, pStmt->bInfo.tbName); + (void)strcpy(pStmt->sql.siInfo.firstName, pStmt->bInfo.tbName); } param->tblData.getFromHash = pStmt->sql.siInfo.tbFromHash; @@ -1248,8 +1248,8 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) { STMT_ERR_RET(qStmtParseQuerySql(&ctx, pStmt->sql.pQuery)); if (pStmt->sql.pQuery->haveResultSet) { - setResSchemaInfo(&pStmt->exec.pRequest->body.resInfo, pStmt->sql.pQuery->pResSchema, - pStmt->sql.pQuery->numOfResCols); + STMT_ERR_RET(setResSchemaInfo(&pStmt->exec.pRequest->body.resInfo, pStmt->sql.pQuery->pResSchema, + pStmt->sql.pQuery->numOfResCols)); taosMemoryFreeClear(pStmt->sql.pQuery->pResSchema); setResPrecision(&pStmt->exec.pRequest->body.resInfo, pStmt->sql.pQuery->precision); } @@ -1301,7 +1301,7 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) { // param->tblData.aCol = taosArrayInit(20, POINTER_BYTES); param->restoreTbCols = false; - strcpy(param->tblData.tbName, pStmt->bInfo.tbName); + (void)strcpy(param->tblData.tbName, pStmt->bInfo.tbName); } int64_t startUs3 = taosGetTimestampUs(); diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 6d9956122c..e53a72814a 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -2940,7 +2940,7 @@ int32_t tmqGetNextResInfo(TAOS_RES* res, bool convertUcs4, SReqResultInfo** pRes doFreeReqResultInfo(&pRspObj->resInfo); SSchemaWrapper* pSW = (SSchemaWrapper*)taosArrayGetP(common->blockSchema, pRspObj->resIter); if (pSW){ - setResSchemaInfo(&pRspObj->resInfo, pSW->pSchema, pSW->nCols); + TAOS_CHECK_RETURN(setResSchemaInfo(&pRspObj->resInfo, pSW->pSchema, pSW->nCols)); } } diff --git a/source/client/src/clientTmqConnector.c b/source/client/src/clientTmqConnector.c index be00ec34c9..26eed6fedf 100644 --- a/source/client/src/clientTmqConnector.c +++ b/source/client/src/clientTmqConnector.c @@ -493,7 +493,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_fetchRawBlockImp( (*env)->SetIntField(env, metadataObj, g_metadataColindexField, i); jstring metadataObjColname = (*env)->NewStringUTF(env, fields[i].name); (*env)->SetObjectField(env, metadataObj, g_metadataColnameField, metadataObjColname); - (*env)->CallBooleanMethod(env, arrayListObj, g_arrayListAddFp, metadataObj); + (void)(*env)->CallBooleanMethod(env, arrayListObj, g_arrayListAddFp, metadataObj); } (*env)->CallVoidMethod(env, rowobj, g_blockdataSetNumOfRowsFp, (jint)numOfRows); @@ -567,7 +567,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_tmq_TMQConnector_tmqGetTopicAssign (*env)->CallVoidMethod(env, jassignment, g_assignmentSetCurrentOffset, assignment.currentOffset); (*env)->CallVoidMethod(env, jassignment, g_assignmentSetBegin, assignment.begin); (*env)->CallVoidMethod(env, jassignment, g_assignmentSetEnd, assignment.end); - (*env)->CallBooleanMethod(env, jarrayList, g_arrayListAddFp, jassignment); + (void)(*env)->CallBooleanMethod(env, jarrayList, g_arrayListAddFp, jassignment); } tmq_free_assignment(pAssign); return JNI_SUCCESS;