Bug #12323 Can not remove schema when editing user information
Submitted: 2 Aug 2005 16:09 Modified: 30 Sep 2005 8:33
Reporter: Mark Manning Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.21 OS:Any (*)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[2 Aug 2005 16:09] Mark Manning
Description:
Created a new user called "nobody".  When granting privileges I mistyped the name of the database (mamb instead of mambo).  When I attempted to bring up Mambo it said it had no privileges to do so.  Corrected my mistake in Administrator but then I tried to remove "mamb" from the list of schemas under the User Administration section.  Could not do so.

How to repeat:
1. Create a user outside of MySQL Administrator.
2. Grant privileges to that user to an unknown database.
3. Enter MySQL Administrator and selecte User Administrator.
4. Select the user you created.
5. Select Schema Privileges.
6. Attempt to delete the non-existent schema from the user's profile.

Suggested fix:
Even though MySQL Administrator would, under normal circumstances, not allow someone to create a user's profile which has non-existent schemas in the list; there are probably times when someone has an already existing database which has gone through several revisions.  If users were created prior to the current set-up, then there is a good possibility that there will be users who have profiles which contain non-existent schemas in them.  Therefore there are two avenues which should be looked at and fixed.  These are:

1. MySQL should not allow the assigning of privileges for a database which is not presently in use.  This would prevent someone from mistyping a schema name in the first place and would force people to first create the database and then assign people to it.

2. MySQL Administrator should have the facility to look and note if a particular schema is no longer a part of the catalogs and if so, at least mark those schemas so they can not be modified.  Ideally, MySQL Administrator should offer a way to remove the schemas.  (Like on the right-click pulldown menu.)  However, it should NEVER just delete them or remove them.  This is because the database the entry refers to might actually reside on another server.
[3 Aug 2005 13:35] Aleksey Kishkin
confirm. List of schemas in the tab "schema privileges" contains existing databases only. And no way to remove grants from database that doesn't exist.
[30 Sep 2005 8:33] Vladimir Kolesnikov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

now an inexistent schema should disappear from user schema priv list after all privs are unassinged from it (and apply button is pressed)