Skip to content

Commit

Permalink
Don't error when trying to delete md5 generated username from mysql
Browse files Browse the repository at this point in the history
This was causing the tests to fail because the unbind operation returns an error, even though the broker successfully deleted the actual user that was created.

Bindings created after circa 2018 all use the new SHA256 method of username generation, and it's fine if the MD5 generated username doesn't exist, which it almost never will.
  • Loading branch information
monotypical committed Dec 2, 2024
1 parent bfd90c4 commit 8280180
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqlengine/mysql_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,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 Down

0 comments on commit 8280180

Please sign in to comment.