Merge pull request #924 from taosdata/feature-master/lihui

[TBASE-1337]
This commit is contained in:
fangpanpan 2019-12-16 13:55:54 +08:00 committed by GitHub
commit ebce945ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -312,7 +312,7 @@ int mgmtUpdateDb(SDbObj *pDb);
SDbObj *mgmtGetDb(char *db);
SDbObj *mgmtGetDbByMeterId(char *db);
int mgmtCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate);
int mgmtDropDbByName(SAcctObj *pAcct, char *name);
int mgmtDropDbByName(SAcctObj *pAcct, char *name, short ignoreNotExists);
int mgmtDropDb(SDbObj *pDb);
/* void mgmtMonitorDbDrop(void *unused); */
void mgmtMonitorDbDrop(void *unused, void *unusedt);

View File

@ -310,10 +310,11 @@ int mgmtDropDb(SDbObj *pDb) {
}
}
int mgmtDropDbByName(SAcctObj *pAcct, char *name) {
int mgmtDropDbByName(SAcctObj *pAcct, char *name, short ignoreNotExists) {
SDbObj *pDb;
pDb = (SDbObj *)sdbGetRow(dbSdb, name);
if (pDb == NULL) {
if (ignoreNotExists) return TSDB_CODE_SUCCESS;
mWarn("db:%s is not there", name);
return TSDB_CODE_INVALID_DB;
}

View File

@ -849,7 +849,7 @@ int mgmtProcessDropDbMsg(char *pMsg, int msgLen, SConnObj *pConn) {
if (!pConn->writeAuth) {
code = TSDB_CODE_NO_RIGHTS;
} else {
code = mgmtDropDbByName(pConn->pAcct, pDrop->db);
code = mgmtDropDbByName(pConn->pAcct, pDrop->db, pDrop->ignoreNotExists);
if (code == 0) {
mLPrint("DB:%s is dropped by %s", pDrop->db, pConn->pUser->user);
}