Bug #2744 user privileges at database level incorrect
Submitted: 12 Feb 2004 7:26 Modified: 21 Jun 2004 14:16
Reporter: Tony Little Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.1a OS:Windows (Windows XP Client - Linux Server)
Assigned to: Michael G. Zinner CPU Architecture:Any

[12 Feb 2004 7:26] Tony Little
Description:
Under 'User Administration' on the 'Schema Privileges' tab, I get nothing in the list for 'Assigned Privileges' even though the user selected at the left has priveleges in the database selected under 'Schemata'.  The user is assigned these privileges with the Db table.  It uses wildcards in the Db field such as 'ash_%' meaning this user has these privileges in all databases that start with 'ash_'.  The privileges work fine - Administrator is just not showing them.  The same thing happens when 'Catalogs' is selected then in the list below a database is selected and the 'Users' tab is selected on the right.  It shows that no users have access to that database even though there are users that do.

A side note: shouldn't the users tab also show users with global privileges since they have access to that database?

How to repeat:
Assign privileges to users specific to a database using a wild card in the Db field (ie 'ash_%').

Suggested fix:
Perhaps it is disregarding it due to the wild card?
[18 Feb 2004 2:40] Michael G. Zinner
Thanks for submitting the report.

Could you tell me, has the user Table/Column privileges assigned (rows in mysql.tables_priv or mysql.columns_priv tables) or Schema privileges (rows in mysql.db table)?

The schema privileges only show entries in the mysql.db table - so privileges for a complete schema.

If the user has Table/Column privileges assigned you need to go to the options and enable the [Show Table/Column Privileges] option.

Creating a manual entries with wildcards in the mysql.tables_priv has not been implemented yet. This will be fixed.

But it is supposed to work with the mysql.db table. Could you verify this?
[18 Feb 2004 8:05] Tony Little
In response to your question. Yes the privileges are in the mysql.db table.  Following I am including a clip of 3 rows from the db table - there are many more, but they are similar to these 3.

+------+---------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| Host | Db            | User             | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv |
+------+---------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
| %    | ash_%         | ash-user         | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                |
| %    | et_%          | et-user          | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                |
| %    | ssk_%         | ssk-user         | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                |
+------+---------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+
[21 Jun 2004 14:16] Michael G. Zinner
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/