Skip to content

Commit

Permalink
Don't error when dropping a non-existent user
Browse files Browse the repository at this point in the history
  • Loading branch information
monotypical committed Dec 2, 2024
1 parent 3fa1640 commit 0c02cfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlengine/mysql_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (d *MySQLEngine) DropUser(bindingID string) error {
return err
}

dropUserStatement := "DROP USER `" + username + "`@`%`;"
dropUserStatement := "DROP USER IF EXISTS `" + username + "`@`%`;"
logger.Debug("drop-user", lager.Data{"statement": dropUserStatement})

_, err := d.db.Exec(dropUserStatement)
Expand All @@ -186,7 +186,7 @@ func (d *MySQLEngine) DropUser(bindingID string) error {
return err
}

dropUserStatement = "DROP USER IF EXISTS`" + username + "`@`%`;"
dropUserStatement = "DROP USER IF EXISTS `" + username + "`@`%`;"
logger.Debug("drop-user", lager.Data{"statement": dropUserStatement})

_, err = d.db.Exec(dropUserStatement)
Expand Down

0 comments on commit 0c02cfa

Please sign in to comment.