ansible/library/database
Stijn Tintel 9d0fc0fd67 Only revoke GRANT OPTION when user actually has it
When revoking privileges from a user, the GRANT OPTION is always
revoked, even if the user doesn't have it. If the user exists, this
doesn't give an error, but if the user doesn't exist, it does:

mysql> GRANT ALL ON test.* TO 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE ALL ON test.* FROM 'test'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> REVOKE GRANT OPTION ON test.* FROM 'test'@'localhost';
ERROR 1141 (42000): There is no such grant defined for user 'test' on
host 'localhost'

Additionally, in MySQL 5.6 this breaks replication because of
http://bugs.mysql.com/bug.php?id=68892.

Rather than revoking the GRANT OPTION and catching the error, check if
the user actually has it and only revoke it when he does.
2013-07-23 13:00:29 +02:00
..
mongodb_user Merge pull request #3172 from gw0/fix-mongodb2.2-compat 2013-06-16 20:24:31 -07:00
mysql_db mysql_db small fix to docs 2013-07-14 13:11:03 +02:00
mysql_user Only revoke GRANT OPTION when user actually has it 2013-07-23 13:00:29 +02:00
postgresql_db DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
postgresql_privs Docs: consistently format playbook EXAMPLES 2013-06-17 08:53:46 +02:00
postgresql_user DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition) 2013-06-15 20:54:25 +02:00
riak Fixed #3433. Using get_bin_path, removed uneeded imports, "module" is inlined, misc other style improvements. 2013-07-05 13:22:44 -04:00