提交 193d2bc3 编写于 作者: L lihui

[TBASE-1337]

上级 d129e3bf
...@@ -312,7 +312,7 @@ int mgmtUpdateDb(SDbObj *pDb); ...@@ -312,7 +312,7 @@ int mgmtUpdateDb(SDbObj *pDb);
SDbObj *mgmtGetDb(char *db); SDbObj *mgmtGetDb(char *db);
SDbObj *mgmtGetDbByMeterId(char *db); SDbObj *mgmtGetDbByMeterId(char *db);
int mgmtCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate); int mgmtCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate);
int mgmtDropDbByName(SAcctObj *pAcct, char *name); int mgmtDropDbByName(SAcctObj *pAcct, char *name, short ignoreNotExists);
int mgmtDropDb(SDbObj *pDb); int mgmtDropDb(SDbObj *pDb);
/* void mgmtMonitorDbDrop(void *unused); */ /* void mgmtMonitorDbDrop(void *unused); */
void mgmtMonitorDbDrop(void *unused, void *unusedt); void mgmtMonitorDbDrop(void *unused, void *unusedt);
......
...@@ -310,10 +310,11 @@ int mgmtDropDb(SDbObj *pDb) { ...@@ -310,10 +310,11 @@ int mgmtDropDb(SDbObj *pDb) {
} }
} }
int mgmtDropDbByName(SAcctObj *pAcct, char *name) { int mgmtDropDbByName(SAcctObj *pAcct, char *name, short ignoreNotExists) {
SDbObj *pDb; SDbObj *pDb;
pDb = (SDbObj *)sdbGetRow(dbSdb, name); pDb = (SDbObj *)sdbGetRow(dbSdb, name);
if (pDb == NULL) { if (pDb == NULL) {
if (ignoreNotExists) return TSDB_CODE_SUCCESS;
mWarn("db:%s is not there", name); mWarn("db:%s is not there", name);
return TSDB_CODE_INVALID_DB; return TSDB_CODE_INVALID_DB;
} }
......
...@@ -849,7 +849,7 @@ int mgmtProcessDropDbMsg(char *pMsg, int msgLen, SConnObj *pConn) { ...@@ -849,7 +849,7 @@ int mgmtProcessDropDbMsg(char *pMsg, int msgLen, SConnObj *pConn) {
if (!pConn->writeAuth) { if (!pConn->writeAuth) {
code = TSDB_CODE_NO_RIGHTS; code = TSDB_CODE_NO_RIGHTS;
} else { } else {
code = mgmtDropDbByName(pConn->pAcct, pDrop->db); code = mgmtDropDbByName(pConn->pAcct, pDrop->db, pDrop->ignoreNotExists);
if (code == 0) { if (code == 0) {
mLPrint("DB:%s is dropped by %s", pDrop->db, pConn->pUser->user); mLPrint("DB:%s is dropped by %s", pDrop->db, pConn->pUser->user);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册