diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 78b038ab19815a7e00f9e30bc0a98e8b792af7b7..32742745c153958c0e2fea55fe06bae5a71efdfa 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1905,9 +1905,6 @@ int tscBuildConnectMsg(SSqlObj *pSql, SSqlInfo *pInfo) { tstrncpy(pConnect->db, db, sizeof(pConnect->db)); pthread_mutex_unlock(&pObj->mutex); - tstrncpy(pConnect->clientVersion, version, sizeof(pConnect->clientVersion)); - tstrncpy(pConnect->msgVersion, "", sizeof(pConnect->msgVersion)); - pConnect->pid = htonl(taosGetPId()); taosGetCurrentAPPName(pConnect->appName, NULL); @@ -2007,7 +2004,6 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) { // TODO the expired hb and client can not be identified by server till now. SHeartBeatMsg *pHeartbeat = (SHeartBeatMsg *)pCmd->payload; - tstrncpy(pHeartbeat->clientVer, version, tListLen(pHeartbeat->clientVer)); pHeartbeat->numOfQueries = numOfQueries; pHeartbeat->numOfStreams = numOfStreams; diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 2a60448a3ea9da64db55062d2e1042db594d77f6..8eff6335774f60232f70b705efe978f1d7afa129 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -212,16 +212,8 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass, tscDebug("%p DB connection is opening, rpcObj: %p, dnodeConn:%p", pObj, pObj->pRpcObj, pObj->pRpcObj->pDnodeConn); taos_free_result(pSql); - - // version compare only requires the first 3 segments of the version string - int code = taosCheckVersion(version, taos_get_server_info(pObj), 3); - if (code != 0) { - terrno = code; - taos_close(pObj); - return NULL; - } else { - return pObj; - } + + return pObj; } return NULL; diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 26ce551e397fccfe6eb378aa0de2de771dfae10f..2c4d21037c9697e832bccf082595408c712d0670 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -335,8 +335,8 @@ typedef struct { typedef struct { int8_t extend; - char clientVersion[TSDB_VERSION_LEN]; - char msgVersion[TSDB_VERSION_LEN]; + char clientVersion[TSDB_VERSION_LEN]; // useless + char msgVersion[TSDB_VERSION_LEN]; // useless char db[TSDB_TABLE_FNAME_LEN]; char appName[TSDB_APPNAME_LEN]; int32_t pid; @@ -920,7 +920,7 @@ typedef struct { typedef struct { int8_t extend; - char clientVer[TSDB_VERSION_LEN]; + char clientVer[TSDB_VERSION_LEN]; // useless uint32_t connId; int32_t pid; int32_t numOfQueries; diff --git a/src/mnode/src/mnodeShow.c b/src/mnode/src/mnodeShow.c index 960987e7ad3b570548d9f8eb93a64ed963a5956b..bebb73eca2c48b8920bcbdc6a22e70aaf509046f 100644 --- a/src/mnode/src/mnodeShow.c +++ b/src/mnode/src/mnodeShow.c @@ -243,10 +243,6 @@ static int32_t mnodeProcessHeartBeatMsg(SMnodeMsg *pMsg) { } SHeartBeatMsg *pHBMsg = pMsg->rpcMsg.pCont; - if (taosCheckVersion(pHBMsg->clientVer, version, 3) != TSDB_CODE_SUCCESS) { - rpcFreeCont(pRsp); - return TSDB_CODE_TSC_INVALID_VERSION; // todo change the error code - } SRpcConnInfo connInfo = {0}; rpcGetConnInfo(pMsg->rpcMsg.handle, &connInfo); @@ -307,11 +303,6 @@ static int32_t mnodeProcessConnectMsg(SMnodeMsg *pMsg) { goto connect_over; } - code = taosCheckVersion(pConnectMsg->clientVersion, version, 3); - if (code != TSDB_CODE_SUCCESS) { - goto connect_over; - } - SUserObj *pUser = pMsg->pUser; SAcctObj *pAcct = pUser->pAcct; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index e0b192be2e007d7c1a193cc13c58ab1224a7bc8d..64c8b0715d9762a09d59540e67af159954bb33ed 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -7945,10 +7945,6 @@ static int32_t deserializeColFilterInfo(SColumnFilterInfo* pColFilters, int16_t int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) { int32_t code = TSDB_CODE_SUCCESS; - if (taosCheckVersion(pQueryMsg->version, version, 3) != 0) { - return TSDB_CODE_QRY_INVALID_MSG; - } - pQueryMsg->numOfTables = htonl(pQueryMsg->numOfTables); pQueryMsg->window.skey = htobe64(pQueryMsg->window.skey); pQueryMsg->window.ekey = htobe64(pQueryMsg->window.ekey); diff --git a/src/util/inc/tutil.h b/src/util/inc/tutil.h index 8756ed49dee5d721096877dbe90ad04d448e1c21..a97b731f93c214536c009e94d05edc5c3d6e7ee9 100644 --- a/src/util/inc/tutil.h +++ b/src/util/inc/tutil.h @@ -41,9 +41,6 @@ char * paGetToken(char *src, char **token, int32_t *tokenLen); int32_t taosByteArrayToHexStr(char bytes[], int32_t len, char hexstr[]); int32_t taosHexStrToByteArray(char hexstr[], char bytes[]); -bool taosGetVersionNumber(char *versionStr, int *versionNubmer); -int taosCheckVersion(char *input_client_version, char *input_server_version, int compared_segments); - char * taosIpStr(uint32_t ipInt); uint32_t ip2uint(const char *const ip_addr); void jsonKeyMd5(void *pMsg, int msgLen, void *pKey); diff --git a/src/util/src/tutil.c b/src/util/src/tutil.c index c7f1385a566427a67a5695eea3943b063b3462b2..8bcef9f32b152082c7ab715ededc996b63558562 100644 --- a/src/util/src/tutil.c +++ b/src/util/src/tutil.c @@ -444,66 +444,6 @@ int32_t taosHexStrToByteArray(char hexstr[], char bytes[]) { return 0; } -// TODO move to comm module -bool taosGetVersionNumber(char *versionStr, int *versionNubmer) { - if (versionStr == NULL || versionNubmer == NULL) { - return false; - } - - int versionNumberPos[5] = {0}; - int len = (int)strlen(versionStr); - int dot = 0; - for (int pos = 0; pos < len && dot < 4; ++pos) { - if (versionStr[pos] == '.') { - versionStr[pos] = 0; - versionNumberPos[++dot] = pos + 1; - } - } - - if (dot != 3) { - return false; - } - - for (int pos = 0; pos < 4; ++pos) { - versionNubmer[pos] = atoi(versionStr + versionNumberPos[pos]); - } - versionStr[versionNumberPos[1] - 1] = '.'; - versionStr[versionNumberPos[2] - 1] = '.'; - versionStr[versionNumberPos[3] - 1] = '.'; - - return true; -} - -int taosCheckVersion(char *input_client_version, char *input_server_version, int comparedSegments) { - char client_version[TSDB_VERSION_LEN] = {0}; - char server_version[TSDB_VERSION_LEN] = {0}; - int clientVersionNumber[4] = {0}; - int serverVersionNumber[4] = {0}; - - tstrncpy(client_version, input_client_version, sizeof(client_version)); - tstrncpy(server_version, input_server_version, sizeof(server_version)); - - if (!taosGetVersionNumber(client_version, clientVersionNumber)) { - uError("invalid client version:%s", client_version); - return TSDB_CODE_TSC_INVALID_VERSION; - } - - if (!taosGetVersionNumber(server_version, serverVersionNumber)) { - uError("invalid server version:%s", server_version); - return TSDB_CODE_TSC_INVALID_VERSION; - } - - for(int32_t i = 0; i < comparedSegments; ++i) { - if (clientVersionNumber[i] != serverVersionNumber[i]) { - uError("the %d-th number of server version:%s not matched with client version:%s", i, server_version, - client_version); - return TSDB_CODE_TSC_INVALID_VERSION; - } - } - - return 0; -} - char *taosIpStr(uint32_t ipInt) { static char ipStrArray[3][30]; static int ipStrIndex = 0;