Bug #8308 GRANT statements getting "lost" without warning/error
Submitted: 4 Feb 2005 3:27 Modified: 28 Nov 2006 23:17
Reporter: Arjen Lentz Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:any OS:Any (any)
Assigned to: Magnus Blåudd CPU Architecture:Any

[4 Feb 2005 3:27] Arjen Lentz
Description:
Sometimes a user does something like
  GRANT REPLICATION SLAVE ON *.* to 'repl'@'192.168.0.*/24' ...

and then
  SHOW GRANTS FOR 'repl'@'192.168.0.*/24';
still shows only
  GRANT USAGE ON *.* TO  'repl'@'192.168.0.*/24' IDENTIFIED BY ...

So the grant just disappeared... as it turns out, they did an upgrade of the MySQL Server without running mysql_fix_privilege_tables. The previous version of the server did not have a field to store the REPLICATION SLAVE grant, so it just vanished. No error.

How to repeat:
Install for instance a 3.23 server, then install 4.x binaries (not from RPM) without running the mysql_fix_privilege_tables script.

(yes this is very silly but the bug system insists I give a "how to repeat" ;-)

Suggested fix:
Server should check its expected table structure on the grant tables, or something similar to that effect.
[4 Feb 2005 6:34] Arjen Lentz
Sorry I meant 'repl'@'192.168.0.%' as the other syntax is not valid. However, that's just a typo on my part. It does not account for the behaviour. So the overall story remains as-is.
[28 Nov 2006 23:17] Magnus Blåudd
Marked as duplicate of Bug#20589  Missing some table level privileges after upgrade.