fix: refactor return code

This commit is contained in:
kailixu 2024-07-24 23:46:06 +08:00
parent 2fd3bf87fc
commit 0d5323c587
2 changed files with 4 additions and 4 deletions

View File

@ -1724,7 +1724,7 @@ static int32_t mndCreateUser(SMnode *pMnode, char *acct, SCreateUserReq *pCreate
if (pCreate->numIpRanges == 0) {
TAOS_CHECK_RETURN(createDefaultIpWhiteList(&userObj.pIpWhiteList));
} else {
SHashObj *pUniqueTab = taosHashInit(64, MurmurHash3_32, false, HASH_NO_LOCK);
SHashObj *pUniqueTab = taosHashInit(64, MurmurHash3_32, true, HASH_NO_LOCK);
if (pUniqueTab == NULL) {
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
}
@ -2082,7 +2082,7 @@ static int32_t mndRemoveTablePriviledge(SMnode *pMnode, SHashObj *hash, SHashObj
int32_t len = strlen(tbFName) + 1;
if (taosHashRemove(hash, tbFName, len) != 0) {
TAOS_RETURN(TSDB_CODE_NOT_FOUND);
TAOS_RETURN(0); // not found
}
int32_t dbKeyLen = strlen(alterReq->objname) + 1;
@ -2093,7 +2093,7 @@ static int32_t mndRemoveTablePriviledge(SMnode *pMnode, SHashObj *hash, SHashObj
if (1 == *currRef) {
if (taosHashRemove(useDbHash, alterReq->objname, dbKeyLen) != 0) {
TAOS_RETURN(TSDB_CODE_NOT_FOUND);
TAOS_RETURN(0); // not found
}
return 0;
}

View File

@ -524,7 +524,7 @@ static int32_t tsdbFSDoSanAndFix(STFileSystem *fs) {
{ // clear unreferenced files
STfsDir *dir = NULL;
TAOS_CHECK_GOTO(tfsOpendir(fs->tsdb->pVnode->pTfs, fs->tsdb->path, &dir), &lino, _exit);
TAOS_CHECK_GOTO(tfsOpendir(fs->tsdb->pVnode->pTfs, fs->tsdb->path, &dir), &lino, _close_dir);
STFileHash fobjHash = {0};
code = tsdbFSCreateFileObjHash(fs, &fobjHash);