From baf947da4b7115da15a664d39a972b4546c34099 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Thu, 5 Oct 2023 14:38:31 +0200 Subject: [PATCH] add a warning when column_case_sensitive in set to false --- plugins/modules/mysql_role.py | 4 ++++ plugins/modules/mysql_user.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/plugins/modules/mysql_role.py b/plugins/modules/mysql_role.py index aac0eb70..9a6d5540 100644 --- a/plugins/modules/mysql_role.py +++ b/plugins/modules/mysql_role.py @@ -1087,6 +1087,10 @@ def main(): try: if state == 'present': if not role.exists: + # TODO Release 4.0.0 : Remove this warning or change the message. + if not column_case_sensitive and "(" in str(priv): + module.warn("column_case_sensitive set to False, column's name will be uppercased") + if subtract_privs: priv = None # avoid granting unwanted privileges if detach_members: diff --git a/plugins/modules/mysql_user.py b/plugins/modules/mysql_user.py index 66215d55..9a0c3490 100644 --- a/plugins/modules/mysql_user.py +++ b/plugins/modules/mysql_user.py @@ -490,6 +490,10 @@ def main(): mode = get_mode(cursor) except Exception as e: module.fail_json(msg=to_native(e)) + + # TODO Release 4.0.0 : Remove this warning or change the message. + if not column_case_sensitive and "(" in str(priv): + module.warn("column_case_sensitive set to False, column's name will be uppercased") priv = privileges_unpack(priv, mode, column_case_sensitive, ensure_usage=not subtract_privs) password_changed = False if state == "present":