diff --git a/src/common/inc/tname.h b/src/common/inc/tname.h index 213aef1bd8c7301acb4be4fc75a0f1d2943b948d..5c2948db763ed97535d5d1027fe283ca96724d92 100644 --- a/src/common/inc/tname.h +++ b/src/common/inc/tname.h @@ -25,7 +25,7 @@ void extractTableName(const char *tableId, char *name); char* extractDBName(const char *tableId, char *name); -int32_t tableIdPrefix(const char* pDb, char* prefix, int32_t len); +size_t tableIdPrefix(const char* pDb, char* prefix, int32_t len); void extractTableNameFromToken(SStrToken *pToken, SStrToken* pTable); diff --git a/src/common/src/tname.c b/src/common/src/tname.c index b86a0ad1d083dfe871a15a32180f26c521b0935f..5c351edf48e10ff3176f38a177142f0f394ee5bd 100644 --- a/src/common/src/tname.c +++ b/src/common/src/tname.c @@ -39,7 +39,7 @@ char* extractDBName(const char* tableId, char* name) { return strncpy(name, &tableId[offset1 + 1], len); } -int32_t tableIdPrefix(const char* name, char* prefix, int32_t len) { +size_t tableIdPrefix(const char* name, char* prefix, int32_t len) { tstrncpy(prefix, name, len); strcat(prefix, TS_PATH_DELIMITER); diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 1505f16812de817d37c629173bb366b7c9a49744..ad50b4929c3d15a9851dd81dcc5cff7210a1c821 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1736,7 +1736,7 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) { STagData *pTagData = (STagData *)pCreate->schema; // it is a tag key char prefix[64] = {0}; - int32_t prefixLen = tableIdPrefix(pMsg->pDb->name, prefix, 64); + size_t prefixLen = tableIdPrefix(pMsg->pDb->name, prefix, 64); if (0 != strncasecmp(prefix, pTagData->name, prefixLen)) { mError("msg:%p, app:%p table:%s, corresponding super table:%s not in this db", pMsg, pMsg->rpcMsg.ahandle, pCreate->tableId, pTagData->name);