未验证 提交 ebce945e 编写于 作者: F fangpanpan 提交者: GitHub

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

[TBASE-1337]
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册