Bug #20049 Different errors between Win/Linux using Grant for a non-existent user
Submitted: 24 May 2006 15:21 Modified: 27 Jun 2006 16:04
Reporter: Erica Moss Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S4 (Feature request)
Version:WIN -5.0.21 LIN 5.0.22 OS:Windows (win32 - XP SP2, Fedora core 5)
Assigned to: CPU Architecture:Any

[24 May 2006 15:21] Erica Moss
Create a user with with a privilege other than CREATE USER that he can grant to others.  Log in as that user and try to GRANT that privilege to a non-existent user.  You receive this error in Windows:
ERROR 1133 (42000): Can't find any matching row in the user table

But you receive this error in Linux:
ERROR 1410: You are not allowed to create a user with GRANT

How to repeat:
# do as root user:

# do as user foo:
GRANT SELECT ON *.* TO 'bar'@'localhost';

Suggested fix:
It's hard to say which is the more appropriate error.  The one given in windows seems to be the most accurate.  The linux error could be interpreted to mean that it is not possible to create a user with GRANT which is untrue, rather that the correct interpretation, "user doesn't exist, and you have not been given permission to create a user."
[27 Jun 2006 16:04] Erica Moss
You are correct, windows by default sets the mode to NO_AUTO_CREATE_USER, and installing linux from source doesn't set a mode.  If you remove that mode from windows then both systems give the less meaningful error.  I'll open a new bug for that if one doesn't exist already.