Bug #109292 Retrieval of DateTime field with the value lost in DST lost hour causes error
Submitted: 6 Dec 2022 9:28 Modified: 18 Apr 2024 12:39
Reporter: Pavan M Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:8.0.19 and later OS:Any (Windows server)
Assigned to: CPU Architecture:Any

[6 Dec 2022 9:28] Pavan M
Description:
With the client/server in the London timezone --

The date "2022-03-27 01:25:25" throws an error as below:
[SqlExceptionHelper] HOUR_OF_DAY: 1 -> 2

This is due to the DateTime field containing the value that is lost within the DST lost hour.

With the connectors version 8.0.17 and before, there is no error thrown.

How to repeat:
1. Set the system's date/time to UTC +00:00 London timezone.
2. Set a date field value to "2022-03-27 01:25:25".
3. Error : "HOUR_OF_DAY: 1 -> 2" will be thrown for MySQL Connector/J v8.0.30.

Suggested fix:
In the database URL, we have to explicitly set serverTimezone=UTC to handle it.
[19 Dec 2022 12:58] MySQL Verification Team
Hi Mr. M,

Please, explain why do you think that this is a bug.

Simply, that time does not exist within DST timezones .......
[20 Jan 2023 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[21 Jul 2023 12:17] Pavan M
This time doesn't exist in the London timezone (UTC +00:00) but exists in other time zones like IST or EST. 
The issue we are facing is the date recorded in our database is in the IST timezone whereas it's accessed from the London timezone(where this time doesn't exist).

With the Mysql Connector 8.0.19 and earlier versions, this conversion from IST to UTC +00:00 used to happen internally before it reached our backend. With the Connector version 8.0.20 and later, this conversion isn't happening leading to the error being thrown as "HOUR_OF_DAY: 1 -> 2".

Let me know if you need more details.
[18 Apr 2024 12:39] MySQL Verification Team
Hello Pavan,

Thank you for the details. However this is not enough to reproduce the issue.
Please upgrade to latest version and report us back if issue persist even in latest version along with test case. Thank you.

Regards,
Ashwini Patil