Bug #6765 Implicit access to time zone description tables requires privileges for them
Submitted: 23 Nov 2004 7:42 Modified: 9 Dec 2004 11:22
Reporter: Dmitry Lenev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.7 OS:Any (Any)
Assigned to: Dmitry Lenev CPU Architecture:Any

[23 Nov 2004 7:42] Dmitry Lenev
Description:
Implicit access to time zone description tables (which happens then you set @@time_zone variable or use CONVERT_TZ() function) requires privileges for them. This happens only if you have some table/column-level grants.

How to repeat:
Create some user with column/table level grants but without any access to 
mysql.time_zone* tables. Try to set @@time_zone variable.

client/mysql -u test --host=192.168.0.4
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.8-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show grants;
+------------------------------------------------------------+
| Grants for test@192.168.0.%                                |
+------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'192.168.0.%'                 |
| GRANT INSERT (i) ON `example`.`t1` TO 'test'@'192.168.0.%' |
+------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> set @@time_zone='Europe/Moscow';
ERROR 1142 (42000): select command denied to user 'test'@'192.168.0.4' for table 'time_zone_name'
[30 Nov 2004 11:39] Dmitry Lenev
ChangeSet
  1.2163 04/11/30 14:29:25 dlenev@brandersnatch.localdomain +24 -0
  Proposed fix for bug #6765 "Implicit access to time zone description
  tables requires privileges for them if some table or column level grants
  present".
[9 Dec 2004 11:22] Dmitry Lenev
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:

ChangeSet
  1.2163 04/12/09 13:31:46 dlenev@brandersnatch.localdomain +24 -0
  Fix for bug #6765 "Implicit access to time zone description
  tables requires privileges for them if some table or column level grants
  present" (with after-review fixes).