puppetlabs/puppetlabs-mysql — pull request #391 by vicinus (2013-12-11 14:36:04+00:00)
Title: Mysql grant fixes

a new try to get the following merged:

1.) mysql 'REVOKE ALL PRIVILEGES [..]' doesn't revoke the 'GRANT OPTION' privilege, which means that the 'GRANT OPTION' privilege can't be removed

2.) valid mysql syntax is 'GRANT SELECT, SELECT, GRANT OPTION, SELECT ON [..]', which means, that if duplicate privileges and 'GRANT OPTION' privileges are not removed from the privileges array, the mysql_grant is done every puppet run.

3.) 'SHOW GRANTS ON . [..]' can return ' [..] WITH MAX_USER_CONNECTIONS [..]' which results in the error message:

Error: Could not prefetch mysql_grant provider 'mysql': undefined method `captures' for nil:NilClass

because the match (match(/WITH\s(.*)\sOPTION$/)) doesn't match and the following "captures" fails therefore.