refact: rename version to td_version
This commit is contained in:
parent
031146b3b5
commit
03814cfe5a
|
@ -194,10 +194,10 @@ extern int32_t tsMinIntervalTime;
|
|||
extern int32_t tsMaxInsertBatchRows;
|
||||
|
||||
// build info
|
||||
extern char version[];
|
||||
extern char compatible_version[];
|
||||
extern char gitinfo[];
|
||||
extern char buildinfo[];
|
||||
extern char td_version[];
|
||||
extern char td_compatible_version[];
|
||||
extern char td_gitinfo[];
|
||||
extern char td_buildinfo[];
|
||||
|
||||
// lossy
|
||||
extern char tsLossyColumns[];
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern char version[];
|
||||
extern char compatible_version[];
|
||||
extern char gitinfo[];
|
||||
extern char gitinfoOfInternal[];
|
||||
extern char buildinfo[];
|
||||
extern char td_version[];
|
||||
extern char td_compatible_version[];
|
||||
extern char td_gitinfo[];
|
||||
extern char td_gitinfoOfInternal[];
|
||||
extern char td_buildinfo[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ int32_t openTransporter(const char *user, const char *auth, int32_t numOfThread,
|
|||
rpcInit.startReadTimer = 1;
|
||||
rpcInit.readTimeout = tsReadTimeout;
|
||||
|
||||
int32_t code = taosVersionStrToInt(version, &(rpcInit.compatibilityVer));
|
||||
int32_t code = taosVersionStrToInt(td_version, &rpcInit.compatibilityVer);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscError("invalid version string.");
|
||||
return code;
|
||||
|
|
|
@ -1700,7 +1700,7 @@ static int32_t buildConnectMsg(SRequestObj* pRequest, SMsgSendInfo** pMsgSendInf
|
|||
tstrncpy(connectReq.app, appInfo.appName, sizeof(connectReq.app));
|
||||
tstrncpy(connectReq.user, pObj->user, sizeof(connectReq.user));
|
||||
tstrncpy(connectReq.passwd, pObj->pass, sizeof(connectReq.passwd));
|
||||
tstrncpy(connectReq.sVer, version, sizeof(connectReq.sVer));
|
||||
tstrncpy(connectReq.sVer, td_version, sizeof(connectReq.sVer));
|
||||
|
||||
int32_t contLen = tSerializeSConnectReq(NULL, 0, &connectReq);
|
||||
void* pReq = taosMemoryMalloc(contLen);
|
||||
|
@ -2573,7 +2573,7 @@ TSDB_SERVER_STATUS taos_check_server_status(const char* fqdn, int port, char* de
|
|||
rpcInit.connLimitNum = connLimitNum;
|
||||
rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
|
||||
rpcInit.readTimeout = tsReadTimeout;
|
||||
if (TSDB_CODE_SUCCESS != taosVersionStrToInt(version, &(rpcInit.compatibilityVer))) {
|
||||
if (TSDB_CODE_SUCCESS != taosVersionStrToInt(td_version, &rpcInit.compatibilityVer)) {
|
||||
tscError("faild to convert taos version from str to int, errcode:%s", terrstr());
|
||||
goto _OVER;
|
||||
}
|
||||
|
|
|
@ -670,7 +670,7 @@ const char *taos_data_type(int type) {
|
|||
}
|
||||
}
|
||||
|
||||
const char *taos_get_client_info() { return version; }
|
||||
const char *taos_get_client_info() { return td_version; }
|
||||
|
||||
// return int32_t
|
||||
int taos_affected_rows(TAOS_RES *res) {
|
||||
|
@ -2144,4 +2144,4 @@ int taos_set_conn_mode(TAOS *taos, int mode, int value) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
char *getBuildInfo() { return buildinfo; }
|
||||
char *getBuildInfo() { return td_buildinfo; }
|
||||
|
|
|
@ -80,8 +80,8 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
goto End;
|
||||
}
|
||||
|
||||
if ((code = taosCheckVersionCompatibleFromStr(version, connectRsp.sVer, 3)) != 0) {
|
||||
tscError("version not compatible. client version: %s, server version: %s", version, connectRsp.sVer);
|
||||
if ((code = taosCheckVersionCompatibleFromStr(td_version, connectRsp.sVer, 3)) != 0) {
|
||||
tscError("version not compatible. client version: %s, server version: %s", td_version, connectRsp.sVer);
|
||||
goto End;
|
||||
}
|
||||
|
||||
|
|
|
@ -675,10 +675,10 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) {
|
|||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "os version", info.version, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "os machine", info.machine, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "version", version, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "compatible_version", compatible_version, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "gitinfo", gitinfo, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "buildinfo", buildinfo, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "version", td_version, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "compatible_version", td_compatible_version, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "gitinfo", td_gitinfo, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_CHECK_RETURN(cfgAddString(pCfg, "buildinfo", td_buildinfo, CFG_SCOPE_BOTH, CFG_DYN_NONE));
|
||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -221,10 +221,9 @@ int32_t taosGenCrashJsonMsg(int signum, char** pMsg, int64_t clusterId, int64_t
|
|||
}
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "memory", tmp), NULL, _exit);
|
||||
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "version", version), NULL, _exit);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "buildInfo", buildinfo), NULL, _exit);
|
||||
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "gitInfo", gitinfo), NULL, _exit);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "version", td_version), NULL, _exit);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "buildInfo", td_buildinfo), NULL, _exit);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "gitInfo", td_gitinfo), NULL, _exit);
|
||||
|
||||
TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "crashSig", signum), NULL, _exit);
|
||||
TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "crashTs", taosGetTimestampUs()), NULL, _exit);
|
||||
|
|
|
@ -297,12 +297,13 @@ static void dmPrintArgs(int32_t argc, char const *argv[]) {
|
|||
static void dmGenerateGrant() { mndGenerateMachineCode(); }
|
||||
|
||||
static void dmPrintVersion() {
|
||||
printf("%s\n%sd version: %s compatible_version: %s\n", TD_PRODUCT_NAME, CUS_PROMPT, version, compatible_version);
|
||||
printf("git: %s\n", gitinfo);
|
||||
printf("%s\n%sd version: %s compatible_version: %s\n", TD_PRODUCT_NAME, CUS_PROMPT, td_version,
|
||||
td_compatible_version);
|
||||
printf("git: %s\n", td_gitinfo);
|
||||
#ifdef TD_ENTERPRISE
|
||||
printf("gitOfInternal: %s\n", gitinfoOfInternal);
|
||||
printf("gitOfInternal: %s\n", td_gitinfoOfInternal);
|
||||
#endif
|
||||
printf("build: %s\n", buildinfo);
|
||||
printf("build: %s\n", td_buildinfo);
|
||||
}
|
||||
|
||||
static void dmPrintHelp() {
|
||||
|
|
|
@ -138,9 +138,9 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
|||
pRpc->info.handle, pRpc->contLen, pRpc->code, pRpc->info.ahandle, pRpc->info.refId);
|
||||
|
||||
int32_t svrVer = 0;
|
||||
code = taosVersionStrToInt(version, &svrVer);
|
||||
code = taosVersionStrToInt(td_version, &svrVer);
|
||||
if (code != 0) {
|
||||
dError("failed to convert version string:%s to int, code:%d", version, code);
|
||||
dError("failed to convert version string:%s to int, code:%d", td_version, code);
|
||||
goto _OVER;
|
||||
}
|
||||
if ((code = taosCheckVersionCompatible(pRpc->info.cliVer, svrVer, 3)) != 0) {
|
||||
|
@ -434,8 +434,8 @@ int32_t dmInitClient(SDnode *pDnode) {
|
|||
rpcInit.startReadTimer = 1;
|
||||
rpcInit.readTimeout = tsReadTimeout;
|
||||
|
||||
if (taosVersionStrToInt(version, &(rpcInit.compatibilityVer)) != 0) {
|
||||
dError("failed to convert version string:%s to int", version);
|
||||
if (taosVersionStrToInt(td_version, &rpcInit.compatibilityVer) != 0) {
|
||||
dError("failed to convert version string:%s to int", td_version);
|
||||
}
|
||||
|
||||
pTrans->clientRpc = rpcOpen(&rpcInit);
|
||||
|
@ -483,8 +483,8 @@ int32_t dmInitStatusClient(SDnode *pDnode) {
|
|||
rpcInit.startReadTimer = 0;
|
||||
rpcInit.readTimeout = 0;
|
||||
|
||||
if (taosVersionStrToInt(version, &(rpcInit.compatibilityVer)) != 0) {
|
||||
dError("failed to convert version string:%s to int", version);
|
||||
if (taosVersionStrToInt(td_version, &rpcInit.compatibilityVer) != 0) {
|
||||
dError("failed to convert version string:%s to int", td_version);
|
||||
}
|
||||
|
||||
pTrans->statusRpc = rpcOpen(&rpcInit);
|
||||
|
@ -533,8 +533,8 @@ int32_t dmInitSyncClient(SDnode *pDnode) {
|
|||
rpcInit.startReadTimer = 1;
|
||||
rpcInit.readTimeout = tsReadTimeout;
|
||||
|
||||
if (taosVersionStrToInt(version, &(rpcInit.compatibilityVer)) != 0) {
|
||||
dError("failed to convert version string:%s to int", version);
|
||||
if (taosVersionStrToInt(td_version, &rpcInit.compatibilityVer) != 0) {
|
||||
dError("failed to convert version string:%s to int", td_version);
|
||||
}
|
||||
|
||||
pTrans->syncRpc = rpcOpen(&rpcInit);
|
||||
|
@ -588,8 +588,8 @@ int32_t dmInitServer(SDnode *pDnode) {
|
|||
rpcInit.compressSize = tsCompressMsgSize;
|
||||
rpcInit.shareConnLimit = tsShareConnLimit * 16;
|
||||
|
||||
if (taosVersionStrToInt(version, &(rpcInit.compatibilityVer)) != 0) {
|
||||
dError("failed to convert version string:%s to int", version);
|
||||
if (taosVersionStrToInt(td_version, &rpcInit.compatibilityVer) != 0) {
|
||||
dError("failed to convert version string:%s to int", td_version);
|
||||
}
|
||||
|
||||
pTrans->serverRpc = rpcOpen(&rpcInit);
|
||||
|
|
|
@ -1021,7 +1021,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
|
|||
}
|
||||
|
||||
// cluster info
|
||||
tstrncpy(pClusterInfo->version, version, sizeof(pClusterInfo->version));
|
||||
tstrncpy(pClusterInfo->version, td_version, sizeof(pClusterInfo->version));
|
||||
pClusterInfo->monitor_interval = tsMonitorInterval;
|
||||
pClusterInfo->connections_total = mndGetNumOfConnections(pMnode);
|
||||
pClusterInfo->dbs_total = sdbGetSize(pSdb, SDB_DB);
|
||||
|
|
|
@ -239,8 +239,8 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
|
|||
goto _OVER;
|
||||
}
|
||||
|
||||
if ((code = taosCheckVersionCompatibleFromStr(connReq.sVer, version, 3)) != 0) {
|
||||
mGError("version not compatible. client version: %s, server version: %s", connReq.sVer, version);
|
||||
if ((code = taosCheckVersionCompatibleFromStr(connReq.sVer, td_version, 3)) != 0) {
|
||||
mGError("version not compatible. client version: %s, server version: %s", connReq.sVer, td_version);
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -308,9 +308,9 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
|
|||
tstrncpy(connectRsp.monitorParas.tsSlowLogExceptDb, tsSlowLogExceptDb, TSDB_DB_NAME_LEN);
|
||||
connectRsp.whiteListVer = pUser->ipWhiteListVer;
|
||||
|
||||
(void)strcpy(connectRsp.sVer, version);
|
||||
(void)snprintf(connectRsp.sDetailVer, sizeof(connectRsp.sDetailVer), "ver:%s\nbuild:%s\ngitinfo:%s", version,
|
||||
buildinfo, gitinfo);
|
||||
tstrncpy(connectRsp.sVer, td_version, sizeof(connectRsp.sVer));
|
||||
(void)snprintf(connectRsp.sDetailVer, sizeof(connectRsp.sDetailVer), "ver:%s\nbuild:%s\ngitinfo:%s", td_version,
|
||||
td_buildinfo, td_gitinfo);
|
||||
mndGetMnodeEpSet(pMnode, &connectRsp.epSet);
|
||||
|
||||
int32_t contLen = tSerializeSConnectRsp(NULL, 0, &connectRsp);
|
||||
|
@ -813,7 +813,7 @@ static int32_t mndProcessSvrVerReq(SRpcMsg *pReq) {
|
|||
int32_t code = 0;
|
||||
int32_t lino = 0;
|
||||
SServerVerRsp rsp = {0};
|
||||
tstrncpy(rsp.ver, version, sizeof(rsp.ver));
|
||||
tstrncpy(rsp.ver, td_version, sizeof(rsp.ver));
|
||||
|
||||
int32_t contLen = tSerializeSServerVerRsp(NULL, 0, &rsp);
|
||||
if (contLen < 0) {
|
||||
|
|
|
@ -115,9 +115,9 @@ static char* mndBuildTelemetryReport(SMnode* pMnode) {
|
|||
snprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "memory", tmp), &lino, _OVER);
|
||||
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "version", version), &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "buildInfo", buildinfo), &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "gitInfo", gitinfo), &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "version", td_version), &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "buildInfo", td_buildinfo), &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "gitInfo", td_gitinfo), &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "email", pMgmt->email), &lino, _OVER);
|
||||
|
||||
mndBuildRuntimeInfo(pMnode, pJson);
|
||||
|
|
|
@ -1217,7 +1217,7 @@ int32_t udfdOpenClientRpc() {
|
|||
connLimitNum = TMIN(connLimitNum, 500);
|
||||
rpcInit.connLimitNum = connLimitNum;
|
||||
rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
|
||||
TAOS_CHECK_RETURN(taosVersionStrToInt(version, &(rpcInit.compatibilityVer)));
|
||||
TAOS_CHECK_RETURN(taosVersionStrToInt(td_version, &rpcInit.compatibilityVer));
|
||||
global.clientRpc = rpcOpen(&rpcInit);
|
||||
if (global.clientRpc == NULL) {
|
||||
fnError("failed to init dnode rpc client");
|
||||
|
@ -1470,9 +1470,9 @@ static int32_t udfdParseArgs(int32_t argc, char *argv[]) {
|
|||
}
|
||||
|
||||
static void udfdPrintVersion() {
|
||||
(void)printf("udfd version: %s compatible_version: %s\n", version, compatible_version);
|
||||
(void)printf("git: %s\n", gitinfo);
|
||||
(void)printf("build: %s\n", buildinfo);
|
||||
(void)printf("udfd version: %s compatible_version: %s\n", td_version, td_compatible_version);
|
||||
(void)printf("git: %s\n", td_gitinfo);
|
||||
(void)printf("build: %s\n", td_buildinfo);
|
||||
}
|
||||
|
||||
static int32_t udfdInitLog() {
|
||||
|
|
|
@ -2902,7 +2902,7 @@ static int32_t rewriteDatabaseFunc(STranslateContext* pCxt, SNode** pNode) {
|
|||
}
|
||||
|
||||
static int32_t rewriteClentVersionFunc(STranslateContext* pCxt, SNode** pNode) {
|
||||
char* pVer = taosStrdup((void*)version);
|
||||
char* pVer = taosStrdup((void*)td_version);
|
||||
if (NULL == pVer) {
|
||||
return terrno;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
char version[64] = "${TD_VER_NUMBER}";
|
||||
char compatible_version[12] = "${TD_VER_COMPATIBLE}";
|
||||
char gitinfo[48] = "${TD_VER_GIT}";
|
||||
char gitinfoOfInternal[48] = "${TD_VER_GIT_INTERNAL}";
|
||||
char buildinfo[64] = "${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}";
|
||||
char td_version[64] = "${TD_VER_NUMBER}";
|
||||
char td_compatible_version[12] = "${TD_VER_COMPATIBLE}";
|
||||
char td_gitinfo[48] = "${TD_VER_GIT}";
|
||||
char td_gitinfoOfInternal[48] = "${TD_VER_GIT_INTERNAL}";
|
||||
char td_buildinfo[64] = "${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}";
|
||||
|
||||
void libtaos_${TD_LIB_VER_NUMBER}_${TD_VER_OSTYPE}_${TD_VER_CPUTYPE}_${TD_VER_VERTYPE}() {};
|
|
@ -440,11 +440,11 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
|
|||
#ifdef TD_ENTERPRISE
|
||||
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion),
|
||||
"%s\n%s version: %s compatible_version: %s\ngit: %s\ngitOfInternal: %s\nbuild: %s", TD_PRODUCT_NAME,
|
||||
CUS_PROMPT, version, compatible_version, gitinfo, gitinfoOfInternal, buildinfo);
|
||||
CUS_PROMPT, td_version, td_compatible_version, td_gitinfo, td_gitinfoOfInternal, td_buildinfo);
|
||||
#else
|
||||
snprintf(shell.info.programVersion, sizeof(shell.info.programVersion),
|
||||
"%s\n%s version: %s compatible_version: %s\ngit: %s\nbuild: %s", TD_PRODUCT_NAME, CUS_PROMPT, version,
|
||||
compatible_version, gitinfo, buildinfo);
|
||||
"%s\n%s version: %s compatible_version: %s\ngit: %s\nbuild: %s", TD_PRODUCT_NAME, CUS_PROMPT, td_version,
|
||||
td_compatible_version, td_gitinfo, td_buildinfo);
|
||||
#endif
|
||||
|
||||
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
|
||||
|
|
|
@ -34,7 +34,7 @@ static void shellWorkAsClient() {
|
|||
rpcInit.user = "_dnd";
|
||||
rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
|
||||
|
||||
taosVersionStrToInt(version, &(rpcInit.compatibilityVer));
|
||||
taosVersionStrToInt(td_version, &rpcInit.compatibilityVer);
|
||||
clientRpc = rpcOpen(&rpcInit);
|
||||
if (clientRpc == NULL) {
|
||||
printf("failed to init net test client since %s\r\n", terrstr());
|
||||
|
@ -125,7 +125,7 @@ static void shellWorkAsServer() {
|
|||
rpcInit.connType = TAOS_CONN_SERVER;
|
||||
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||
|
||||
taosVersionStrToInt(version, &(rpcInit.compatibilityVer));
|
||||
taosVersionStrToInt(td_version, &rpcInit.compatibilityVer);
|
||||
|
||||
void *serverRpc = rpcOpen(&rpcInit);
|
||||
if (serverRpc == NULL) {
|
||||
|
|
Loading…
Reference in New Issue