puppetlabs/puppetlabs-mysql — pull request #359 by vicinus (2013-11-05 22:57:19+00:00)
Title: mysql_grant issues

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.