Merge pull request #924 from taosdata/feature-master/lihui
[TBASE-1337]
This commit is contained in:
commit
ebce945ee1
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue