[CONJ-202] java.sql.SQLException: The server time_zone 'EDT' cannot be parse by java connector. Created: 2015-10-06 Updated: 2015-10-06 Resolved: 2015-10-06 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.3.0 |
| Fix Version/s: | 1.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Christian Bourque | Assignee: | Diego Dupin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Opening a simple connection to MariaDB using current development driver (1.3.0-20150928.170949-11) leads to an exception (works fine with 1.2.3): java.sql.SQLException: The server time_zone 'EDT' cannot be parse by java connector. The server time zone must be precised in the jdbc url string by the 'serverTimezone' parameter (or change server time zone) |
| Comments |
| Comment by Christian Bourque [ 2015-10-06 ] |
|
It works with 1.3.0-beta-2 as well! |
| Comment by Christian Bourque [ 2015-10-06 ] |
|
Hmmm I just realized that my snapshot is really old (2015-09-28)! Is it normal that this is the latest one available here: https://oss.sonatype.org/content/repositories/snapshots? |
| Comment by Diego Dupin [ 2015-10-06 ] |
|
We rely on Java time zone implementation to retrieve timezone from server Time zone value. (Snapshot is now up) |
| Comment by Diego Dupin [ 2015-10-06 ] |
|
I confirm that only this snapshot has this error, current release version 1.2.3 and next version 1.3.0 doesn't have the problem. For information, if using next option useLegacyDatetimeCode=false ( version > 1.3.0) you will have this problem too, because EDT is not a valid time zone (note sure of that, but the valid time zone corresponding to this one must be EST5EDT). I close this issue. Feel free to answer, or recreate another one if not. |
| Comment by Christian Bourque [ 2015-10-06 ] |
|
Hey Diego, I can confirm that EDT is a valid timezone: https://en.wikipedia.org/wiki/Eastern_Time_Zone And that Java 7 is able to parse its ID: TimeZone tz = TimeZone.getTimeZone("EDT"); |
| Comment by Diego Dupin [ 2015-10-06 ] |
|
If you list TimeZone.getAvailableIDs(), you will not find this ID. tzdata source distribution doesn't have this "EDT" Too, but have "US/Eastern" for backward compatibility. |
| Comment by Christian Bourque [ 2015-10-06 ] |
|
Well this is a problem because "EDT" is the actual value returned on our Linux/MariaDB server! Even though the real timezone is mapped like that: /etc/localtime -> /usr/share/zoneinfo/America/Montreal |
| Comment by Diego Dupin [ 2015-10-06 ] |
|
to be sure, check mariadb time_zone with this query : SHOW GLOBAL VARIABLES LIKE 'time_zone'; America/Montreal file is EST5EDT on debian 8. It will not cause problem for MariaDB connector/J actually, you must just known that if a java application is on the same server, by default timestamps will be saved on GMT, not EDT time. |
| Comment by Christian Bourque [ 2015-10-06 ] |
|
Indeed "SYSTEM" is returned! Thanks |