| Bug #64599 | CONVERT_TZ fails to convert from GMT to system_time_zone | ||
|---|---|---|---|
| Submitted: | 9 Mar 2012 7:32 | Modified: | 9 Mar 2012 17:36 |
| Reporter: | Mark Stafford | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
| Version: | 5.0.87, 5.6.5 | OS: | Linux |
| Assigned to: | CPU Architecture: | Any | |
[9 Mar 2012 17:36]
Sveta Smirnova
Thank you for the report. This is actually not related to @@system_time_zone: mysql> select convert_tz(utc_timestamp(), 'GMT', 'PST'); +-------------------------------------------+ | convert_tz(utc_timestamp(), 'GMT', 'PST') | +-------------------------------------------+ | NULL | +-------------------------------------------+ 1 row in set (0.00 sec) But I agree warning must be issued, so set to "Verified".
[9 Mar 2012 17:39]
Sveta Smirnova
This looks similar to bug #12445, although in this case timezone tables were loaded.

Description: MySQL accepts values for system_time_zone that are not supported in the CONVERT_TZ function. How to repeat: Having populated the time zone information via mysql_tzinfo_to_sql and restarted the server the following call to convert_tz returns NULL: > select convert_tz(utc_timestamp(), 'GMT', 'PST8PDT') succeeds , convert_tz(utc_timestamp(), 'GMT', @@system_time_zone) fails , @@system_time_zone \G *************************** 1. row *************************** succeeds: 2012-03-08 23:30:40 fails: NULL @@system_time_zone: PST 1 row in set (0.00 sec) Suggested fix: Any system_time_zone value that is not acceptable for use in CONVERT_TZ should produce warning output. Either that or the output from mysql_tzinfo_to_sql may need to be expanded to include all acceptable values for system_time_zone.