Bug #74467 Default time-zone is not saved
Submitted: 21 Oct 2014 0:53 Modified: 21 Oct 2014 20:04
Reporter: Marco Janc Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.6 OS:Windows (7)
Assigned to: CPU Architecture:Any
Tags: time, timezone

[21 Oct 2014 0:53] Marco Janc
Description:
In my ini file I have following time-zone default value: (In Workbench the correct values are also shown.)

    innodb = ON
    default-time-zone = '+00:00'

When I restart the server I always get 'SYSTEM' when I execute following query: 

    SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;

From my application Dates are not saved in my system timezone and not in UTC.

Workaround:

I manually have to call at start:

    SET GLOBAL time_zone = '+00:00';
    SET SESSION time_zone = '+00:00';

How to repeat:
Use INNODB engine.

Set in workbench or ini file default time-zone to other then system timezone.

Check with query time_zone.
[21 Oct 2014 1:46] Marco Janc
The DateTime column i observed was not setted by application but by default value, so this bug is not related to any client application.

foo DATETIME DEFAULT NOW() ON UPDATE NOW()
[21 Oct 2014 17:31] MySQL Verification Team
Thank you for the bug report.

C:\ProgramData\MySQL\MySQL Server 5.6>type my.ini | findstr default-time
default-time-zone = '+00:00'

C:\ProgramData\MySQL\MySQL Server 5.6>c:\dbs\5.6\bin\mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.21-log MySQL Community Server (GPL)

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> SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;
+--------------------+---------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone |
+--------------------+---------------------+
| +00:00             | +00:00              |
+--------------------+---------------------+
1 row in set (0.00 sec)
[21 Oct 2014 20:04] Marco Janc
In folder 'Program Data' there really is no 'default-time-zone' setting in 'my.ini' file. 

I know 'Program Data' has precedence over other folders, but

Workbench is instructed to use the 'my.ini' from 'Program Files' and settings are shown correctly in workbench.