mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-03 04:34:27 -07:00
When using statement based replication in a master-master configuration
there exists a race condition that can break replication when dropping a user. Ideally one would use the "sql_log_bin: no" option to avoid this but that is not possible on Google CloudSQL instances. Adding IF EXISTS clause to the DROP USER statement makes it replication safe without the need to skip logging.
This commit is contained in:
parent
952e1666d8
commit
175ad8899c
1 changed files with 1 additions and 1 deletions
|
@ -368,7 +368,7 @@ def user_delete(cursor, user, host, host_all, check_mode):
|
|||
hostnames = [host]
|
||||
|
||||
for hostname in hostnames:
|
||||
cursor.execute("DROP USER %s@%s", (user, hostname))
|
||||
cursor.execute("DROP USER IF EXIST %s@%s", (user, hostname))
|
||||
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue