Merge pull request #594 from skroll/escape_backslash

Fix escaped backslashes in grants
This commit is contained in:
Igor Galić 2014-11-07 15:23:52 +01:00
commit 8dd37aea3a

View file

@ -29,6 +29,8 @@ Puppet::Type.type(:mysql_grant).provide(:mysql, :parent => Puppet::Provider::Mys
# Matching: GRANT (SELECT, UPDATE) PRIVILEGES ON (*.*) TO ('root')@('127.0.0.1') (WITH GRANT OPTION)
if match = munged_grant.match(/^GRANT\s(.+)\sON\s(.+)\sTO\s(.*)@(.*?)(\s.*)?$/)
privileges, table, user, host, rest = match.captures
table.gsub!('\\\\', '\\')
# split on ',' if it is not a non-'('-containing string followed by a
# closing parenthesis ')'-char - e.g. only split comma separated elements not in
# parentheses