[TBASE-1337]

This commit is contained in:
lihui 2019-12-14 16:54:06 +08:00
parent 115912544d
commit 04b511632b
3 changed files with 4 additions and 3 deletions

View File

@ -314,7 +314,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

@ -763,7 +763,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);
}