From aeb19d1eb074a1bc6d869f36f73ff929f50299f8 Mon Sep 17 00:00:00 2001 From: lihui Date: Thu, 21 Nov 2019 19:24:06 +0800 Subject: [PATCH] [TBASE-1215] --- src/client/inc/tsclient.h | 2 +- src/client/src/tscServer.c | 4 ++-- src/inc/taosmsg.h | 4 ++-- src/system/detail/inc/mgmt.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 7341d674d3..7767dfd551 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -346,7 +346,7 @@ typedef struct _tsc_obj { char user[TSDB_USER_LEN]; char pass[TSDB_KEY_LEN]; char acctId[TSDB_DB_NAME_LEN]; - char db[TSDB_DB_NAME_LEN]; + char db[TSDB_METER_ID_LEN]; char sversion[TSDB_VERSION_LEN]; char writeAuth : 1; char superAuth : 1; diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 436bfa327a..69d1f89079 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1795,7 +1795,7 @@ int tscBuildCreateDbMsg(SSqlObj *pSql) { pMsg += sizeof(SMgmtHead); pCreateDbMsg = (SCreateDbMsg *)pMsg; - strcpy(pCreateDbMsg->db, pMeterMetaInfo->name); + strncpy(pCreateDbMsg->db, pMeterMetaInfo->name, tListLen(pCreateDbMsg->db)); pMsg += sizeof(SCreateDbMsg); msgLen = pMsg - pStart; @@ -2017,7 +2017,7 @@ int tscBuildDropDbMsg(SSqlObj *pSql) { pMsg += sizeof(SMgmtHead); pDropDbMsg = (SDropDbMsg *)pMsg; - strcpy(pDropDbMsg->db, pMeterMetaInfo->name); + strncpy(pDropDbMsg->db, pMeterMetaInfo->name, tListLen(pDropDbMsg->db)); pDropDbMsg->ignoreNotExists = htons(pCmd->existsCheck ? 1 : 0); diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index d02251c212..5cc06a751c 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -309,7 +309,7 @@ typedef struct { } SCreateMsg; typedef struct { - char db[TSDB_DB_NAME_LEN]; + char db[TSDB_METER_ID_LEN]; short ignoreNotExists; } SDropDbMsg, SUseDbMsg; @@ -594,7 +594,7 @@ typedef struct { // NOTE: sizeof(SVnodeCfg) < TSDB_FILE_HEADER_LEN/4 typedef struct { char acct[TSDB_USER_LEN]; - char db[TSDB_DB_NAME_LEN]; + char db[TSDB_METER_ID_LEN+2]; // 8bytes align uint32_t vgId; int32_t maxSessions; int32_t cacheBlockSize; diff --git a/src/system/detail/inc/mgmt.h b/src/system/detail/inc/mgmt.h index 7cdc36a446..112e75ef1e 100644 --- a/src/system/detail/inc/mgmt.h +++ b/src/system/detail/inc/mgmt.h @@ -157,7 +157,7 @@ typedef struct _vg_obj { } SVgObj; typedef struct _db_obj { - char name[TSDB_DB_NAME_LEN + 1]; + char name[TSDB_METER_ID_LEN + 1]; int64_t createdTime; SDbCfg cfg; int32_t numOfVgroups; -- GitLab