Skip to content

Commit

Permalink
Allow uppercase in variable names for Galera wsrep variables (#501)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
paulcampbell-payroc and Andersson007 authored Feb 4, 2023
1 parent b8d6474 commit 521443a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion plugins/modules/mysql_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 521443a

Please sign in to comment.