Allow uppercase in variable names for Galera wsrep variables (#501)

* Allow uppercase in variable names for Galera wsrep variables

* Changelog fragment for regex change

* Corrected for excessive line lengths

* Update changelogs/fragments/mysql_variables_allow_uppercase_identifiers.yml

---------

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
This commit is contained in:
Paul Campbell 2023-02-04 07:31:00 +00:00 committed by GitHub
parent b8d6474540
commit 521443a671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,6 @@
---
bugfixes:
- mysql_variables - add uppercase character pattern to regex to allow GLOBAL
variables containing uppercase 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).

View file

@ -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)