Add version comments to limit IF EXISTS clause only to versions that support it.

This commit is contained in:
MattMontgomeryKochava 2022-02-13 10:18:53 -06:00
commit c194df3e51
2 changed files with 2 additions and 2 deletions

View file

@ -368,7 +368,7 @@ def user_delete(cursor, user, host, host_all, check_mode):
hostnames = [host]
for hostname in hostnames:
cursor.execute("DROP USER IF EXISTS %s@%s", (user, hostname))
cursor.execute("DROP USER /*!50700 IF EXISTS */ /*M!100103 IF EXISTS */ %s@%s", (user, hostname))
return True

View file

@ -741,7 +741,7 @@ class Role():
if check_mode and self.exists:
return True
self.cursor.execute('DROP ROLE %s', (self.name,))
self.cursor.execute('DROP ROLE /*!50700 IF EXISTS */ /*M!100100 IF EXISTS */ %s', (self.name,))
return True
def update_members(self, users, check_mode=False, append_members=False,