Bug #72570 mysqluserclone shows grants twice
Submitted: 8 May 2014 11:57 Modified: 12 Jun 2014 1:49
Reporter: Shahriyar Rzayev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Utilities Severity:S1 (Critical)
Version:1.4.2 OS:Linux (CentOS 6.5)
Assigned to: CPU Architecture:Any

[8 May 2014 11:57] Shahriyar Rzayev
Description:
Here is user list of MySQL 5.6.17:

mysql> select user, host from mysql.user;
+---------+-----------+
| user    | host      |
+---------+-----------+
| remote  | %         |
| repl    | %         |
| ssluser | %         |
| root    | 127.0.0.1 |
| root    | ::1       |
| root    | localhost |
+---------+-----------+
6 rows in set (0,00 sec)

When i use mysqluserclone it shows same grant twice:

[root@linuxsrv3 ~]# mysqluserclone --source='root:12345@localhost' --dump 'ssluser'@'%'
# Source on localhost: ... connected.
# Dumping grants for user ssluser@%
GRANT ALL PRIVILEGES ON *.* TO 'ssluser'@'%' IDENTIFIED BY PASSWORD '*A2D73F3748C78DE12A161011AADA385D608EF6D4' REQUIRE SSL
GRANT ALL PRIVILEGES ON *.* TO 'ssluser'@'%' IDENTIFIED BY PASSWORD '*A2D73F3748C78DE12A161011AADA385D608EF6D4' REQUIRE SSL

How to repeat:
Setup stand-alone 1.4.2 mysql-utilities package and user mysqluserclone with dump option.

Suggested fix:
No idea.
[9 May 2014 8:43] MySQL Verification Team
Hello Shahriyar,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[9 May 2014 8:45] MySQL Verification Team
// from mysql> prompt

mysql> select user from mysql.user where user='ushastry';
+----------+
| user     |
+----------+
| ushastry |
+----------+
1 row in set (0.00 sec)

mysql> show grants for 'ushastry'@'%';
+---------------------------------------------------------------------------------------------------------+
| Grants for ushastry@%                                                                                   |
+---------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'ushastry'@'%' IDENTIFIED BY PASSWORD '*23AE809DDACAF96AF0FD78ED04B6A265E05AA257' |
| GRANT ALL PRIVILEGES ON `test`.* TO 'ushastry'@'%'                                                      |
+---------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

// When using mysqlclone

# scripts/mysqluserclone --source='root@localhost' --dump 'ushastry'@'%'
# Source on localhost: ... connected.
# Dumping grants for user ushastry@%
GRANT USAGE ON *.* TO 'ushastry'@'%' IDENTIFIED BY PASSWORD '*23AE809DDACAF96AF0FD78ED04B6A265E05AA257'
GRANT ALL PRIVILEGES ON `test`.* TO 'ushastry'@'%'
GRANT USAGE ON *.* TO 'ushastry'@'%' IDENTIFIED BY PASSWORD '*23AE809DDACAF96AF0FD78ED04B6A265E05AA257'
GRANT ALL PRIVILEGES ON `test`.* TO 'ushastry'@'%'
#
[12 Jun 2014 1:49] Philip Olson
Fixed as of the upcoming MySQL Utilities 1.4.4 release, and here's the changelog entry:

When passing in the "--dump" option to the "mysqluserclone" utility on a user
with the hostname '%', the output (each grant) would be printed twice.

Thank you for the bug report.