From 99ef55c7d456756549235ca172d2fbaebbf15937 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Fri, 23 Dec 2022 16:02:08 +0800 Subject: [PATCH] query(fix): return new error code except connect msg --- source/client/src/clientImpl.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index b480b0b230..4b4a1c368f 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -1425,24 +1425,18 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) { } // pMsg is response msg - switch (pMsg->msgType) { - case TDMT_VND_BATCH_META + 1: - case TDMT_VND_SUBMIT + 1: - case TDMT_SCH_QUERY + 1: - case TDMT_SCH_MERGE_QUERY + 1: - // uniform to one error code: TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED - if (pMsg->code == TSDB_CODE_RPC_SOMENODE_BROKEN_LINK) { - pMsg->code = TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED; - } - break; - default: - // restore origin code - if (pMsg->code == TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED) { - pMsg->code = TSDB_CODE_RPC_NETWORK_UNAVAIL; - } else if (pMsg->code == TSDB_CODE_RPC_SOMENODE_BROKEN_LINK) { - pMsg->code = TSDB_CODE_RPC_BROKEN_LINK; - } - break; + if (pMsg->msgType != TDMT_MND_CONNECT + 1) { + // uniform to one error code: TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED + if (pMsg->code == TSDB_CODE_RPC_SOMENODE_BROKEN_LINK) { + pMsg->code = TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED; + } + } else { + // restore origin code + if (pMsg->code == TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED) { + pMsg->code = TSDB_CODE_RPC_NETWORK_UNAVAIL; + } else if (pMsg->code == TSDB_CODE_RPC_SOMENODE_BROKEN_LINK) { + pMsg->code = TSDB_CODE_RPC_BROKEN_LINK; + } } AsyncArg* arg = taosMemoryCalloc(1, sizeof(AsyncArg)); -- GitLab