Bug #73840 SYSTEM_TIME_ZONE is truncated at 29 characters
Submitted: 8 Sep 2014 17:02 Modified: 8 Sep 2014 22:40
Reporter: Eric U Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.5/5.6/5.7 OS:Windows
Assigned to: CPU Architecture:Any

[8 Sep 2014 17:02] Eric U
Description:
On Windows Server 2003 R2 or Windows 2008 R2 when the OS timezone is set to a value that is longer than 29 characters, e.g. "E. South America Daylight Time" (Brasilia) or "Central European Standard Time" (Sarajevo), the SYSTEM_TIME_ZONE global variable on the MySQL server only contains the first 29 characters.  In both examples of these time zones, the final 'e' character is removed.

This is a problem because in Connector J, TimeUtil.java expects the full 30 character names, as shown at http://bazaar.launchpad.net/~mysql/connectorj/5.1/view/head:/src/com/mysql/jdbc/TimeUtil.j...

A default install of MySQL has global and session time zones set to SYSTEM.  A workaround for this issue is to set the default-time-zone in the my.ini file.

The length of the VARIABLE_VALUE column in GLOBAL_VARIABLES is 1024, so does not appear to be caused by that.

How to repeat:
Check that the "SYSTEM" timezone is being used in a MySQL server that is installed on Windows Server 2003 or 2008 (I did not test Win 2012).

Set OS timezone to "(GMT -03:00) Brasilia" and restart MySQL service if it was already running.

Run:
select * from GLOBAL_VARIABLES where variable_name="SYSTEM_TIME_ZONE";

The actual result is that "E. South America Standard Tim" is returned.
The expected result is that "E. South America Standard Time" should be returned.
[8 Sep 2014 17:04] Eric U
Screenshot showing output of query and also confirming MySQL version

Attachment: MySQLTimeZoneTruncated.PNG (image/png, text), 52.84 KiB.

[8 Sep 2014 22:30] MySQL Verification Team
C:\dbs>net start mysqld56
The MySQLD56 service is starting..
The MySQLD56 service was started successfully.

C:\dbs>56

C:\dbs>c:\dbs\5.6\bin\mysql -uroot --port=3560 --debug-info --prompt="mysql 5.6 > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql 5.6 > USE INFORMATION_SCHEMA
Database changed
mysql 5.6 > select * from GLOBAL_VARIABLES where variable_name="SYSTEM_TIME_ZONE";
+------------------+-------------------------------+
| VARIABLE_NAME    | VARIABLE_VALUE                |
+------------------+-------------------------------+
| SYSTEM_TIME_ZONE | E. South America Standard Tim |
+------------------+-------------------------------+
1 row in set (0.00 sec)

mysql 5.6 > DESC GLOBAL_VARIABLES\G
*************************** 1. row ***************************
  Field: VARIABLE_NAME
   Type: varchar(64)
   Null: NO
    Key:
Default:
  Extra:
*************************** 2. row ***************************
  Field: VARIABLE_VALUE
   Type: varchar(1024)
   Null: YES
    Key:
Default: NULL
  Extra:
2 rows in set (0.03 sec)

mysql 5.6 > exit
Bye

C:\dbs>tzutil /g
E. South America Standard Time_dstoff
C:\dbs>
[8 Sep 2014 22:40] MySQL Verification Team
Thank you for the bug report.
[30 Apr 2015 4:55] Srinivas chandolu
Any update on the fix?