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

Fix #3224 - conversion for TIME '24:00' to LocalTime breaks in binary-mode #3225

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

pmenke-de
Copy link
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Existing Features:

  • Does this break existing behaviour? If so please explain.
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

Description

Fixes the bug described in #3224

Conversion of binary-values of TIME has been adapted to interpret 24:00 as LocalTime.MAX - as does conversion from text-values.
As PostgreSQL only supports microsecond-precision, all values larger than 23:59:59.999_999_499 are converted to LocalTime.MAX - as is done in other places in TimestampUtils.java

Binary test-values for TimestampUtilsTest.java are guessed, as I couldn't find a documentation / source, of how they're actually computed.

add tests which verify, that conversion of binary-transferred TIME/TIMETZ `24:00` to LocalTime currently fails
fixes conversion of TIME/TIMETZ `24:00` to LocalTime from binary.
we now convert `24:00` to `LocalTime.MAX` instead of failing with `Invalid value for NanoOfDay`, which is now consistent with conversion from text.
`#setUp()` and `#tearDown()` manage the test-table's lifecycle. the test-table gets dropped at end of test anyway.
@davecramer davecramer merged commit 8afde80 into pgjdbc:master Apr 23, 2024
16 checks passed
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.

None yet

2 participants