Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, 5.6.15+, 5.7.3+
Bug #18415196 MYSQL_UPGRADE DUPLICATE KEY ERROR FOR MYSQL.USER FOR 5.5.35+, 5.6.15+, 5.7.3+

Description: mysql_upgrade fails with below error, 
when there are duplicate entries(like 'root'@'LOCALHOST'
and 'root'@'localhost') in mysql.user table.
ERROR 1062 (23000) at line 1140: Duplicate entry 'localhost-root' for key 'PRIMARY'
FATAL ERROR: Upgrade failed

Analysis: As part of the bug 12917151 fix we are 
making all the hostnames as lower case hostnames.
So, this has been done by mysql_upgrade.
In case of above mentioned duplicate entries 
mysql_upgrade tries to change hostname to lowercase.
Since there is already 'root'@'localhost' exists.
it is failing with "duplicate entry" error.

Fix: Since its a valid error failure. We are 
making the error more verbose. So, that user will
delete the duplicate errors manually.
Along with existing error we are printing below
error as well.
ERROR 1644 (45000) at line 1153: Multiple accounts exist for @user_name, @host_name that differ only in Host lettercase; remove all except one of them

flynn1973/mariadb-aix,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-aix,davidl-zend/zenddbi,natsys/mariadb_10.2,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,natsys/mariadb_10.2,davidl-zend/zenddbi,davidl-zend/zenddbi,ollie314/server,ollie314/server,ollie314/server,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi,davidl-zend/zenddbi,natsys/mariadb_10.2,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,natsys/mariadb_10.2,natsys/mariadb_10.2,flynn1973/mariadb-aix,natsys/mariadb_10.2,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-aix,ollie314/server,ollie314/server,flynn1973/mariadb-aix,natsys/mariadb_10.2,flynn1973/mariadb-aix,slanterns/server,ollie314/server,natsys/mariadb_10.2