From 4728a3a9f49b1ff7af83e65a2d2500669cf1b48d Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 1 Feb 2023 17:37:15 +0000 Subject: [PATCH 1/4] Allow uppercase in variable names for Galera wsrep variables --- plugins/modules/mysql_variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/mysql_variables.py b/plugins/modules/mysql_variables.py index dc54c822..f404d5aa 100644 --- a/plugins/modules/mysql_variables.py +++ b/plugins/modules/mysql_variables.py @@ -199,7 +199,7 @@ def main(): if mysqlvar is None: module.fail_json(msg="Cannot run without variable to operate with") - if match('^[0-9a-z_.]+$', mysqlvar) is None: + if match('^[0-9A-Za-z_.]+$', mysqlvar) is None: module.fail_json(msg="invalid variable name \"%s\"" % mysqlvar) if mysql_driver is None: module.fail_json(msg=mysql_driver_fail_msg) From 9a9b127fdfab053ab58d872d876a831a4f5df135 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 2 Feb 2023 09:11:31 +0000 Subject: [PATCH 2/4] Changelog fragment for regex change --- .../fragments/mysql_variables_allow_uppercase_identifiers.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml diff --git a/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml b/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml new file mode 100644 index 00000000..7802e8ff --- /dev/null +++ b/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml @@ -0,0 +1,4 @@ +--- +bugfix: + - mysql_variables - Add uppercase character pattern to regex to allow GLOBAL variables containing uppercase characters. + This recognises variable names used in Galera, e.g. wsrep_OSU_method, which break the normal pattern of all lowercase characters. From f0671645b384be2cf28044ac689cc8aa4d4c6c24 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 2 Feb 2023 10:11:43 +0000 Subject: [PATCH 3/4] Corrected for excessive line lengths --- .../mysql_variables_allow_uppercase_identifiers.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml b/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml index 7802e8ff..59458f92 100644 --- a/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml +++ b/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml @@ -1,4 +1,6 @@ --- bugfix: - - mysql_variables - Add uppercase character pattern to regex to allow GLOBAL variables containing uppercase characters. - This recognises variable names used in Galera, e.g. wsrep_OSU_method, which break the normal pattern of all lowercase characters. + - mysql_variables - Add uppercase character pattern to regex to allow GLOBAL + variables containing uppercase characters. + This recognises variable names used in Galera, e.g. wsrep_OSU_method, + which break the normal pattern of all lowercase characters. From 22fb24699b4c96fde1db4dfa08e54aab86b3e535 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Thu, 2 Feb 2023 12:48:20 +0100 Subject: [PATCH 4/4] Update changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml --- .../mysql_variables_allow_uppercase_identifiers.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml b/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml index 59458f92..0d354672 100644 --- a/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml +++ b/changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml @@ -1,6 +1,6 @@ --- -bugfix: - - mysql_variables - Add uppercase character pattern to regex to allow GLOBAL +bugfixes: + - mysql_variables - add uppercase character pattern to regex to allow GLOBAL variables containing uppercase characters. - This recognises variable names used in Galera, e.g. wsrep_OSU_method, - which break the normal pattern of all lowercase characters. + This recognizes variable names used in Galera, for example, ``wsrep_OSU_method``, + which breaks the normal pattern of all lowercase characters (https://github.com/ansible-collections/community.mysql/pull/501).