Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch HOUR_OF_DAY error #1160

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Catch HOUR_OF_DAY error #1160

wants to merge 5 commits into from

Conversation

jbaiza
Copy link
Contributor

@jbaiza jbaiza commented Oct 22, 2024

If the time stored in the missing daylight saving hour, MySQL JDBC driver starting from version 8.0.23 will raise this error (https://dev.mysql.com/doc/relnotes/connector-j/en/news-8-0-23.html).
If the date time value stored in the column actually is UTC time, then it will return a string representation of the value, not the time converted to the local time zone.
More in #1091

If the time stored in the missing daylight saving hour, MySQL JDBC driver starting from version 8.0.23 will raise this error (https://dev.mysql.com/doc/relnotes/connector-j/en/news-8-0-23.html)
If the date time value stored in the column actually is UTC time, then will return string representation of the value, not the time converted to the local time zone.
@headius
Copy link
Member

headius commented Oct 22, 2024

Per discussion in #1091 perhaps this is a "good enough" fix to merge now while we try to figure out a better long-term option?

@jbaiza
Copy link
Contributor Author

jbaiza commented Oct 22, 2024

I will work on the new test failures to find out where the environment time zone impacted the results despite that it's set in the tests:

with_system_tz 'Europe/Prague' do
  Time.use_zone 'Europe/Prague' do

When time zone is changed, JDBC connection still will contain initial time zone. Therefore we need to recreate connection with the newly set TZ
With AR default timezone set to :local, PostgreSQL driver will try to convert missing DST time and will fail.
@jbaiza jbaiza marked this pull request as ready for review October 23, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants