trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.18k stars 2.94k forks source link

Incorrect java.sql.Time returned from JDBC ResultSet for TIME WITH TIME ZONE requiring wrap around #6351

Open findepi opened 3 years ago

findepi commented 3 years ago
actual = {java.sql.Time@14162} "20:59:56"
 jcal = null
 fastTime = 17996123
 cdate = {sun.util.calendar.Gregorian$Date@16961} "1969-12-31T20:59:56.123-0800"
 defaultCenturyStart = 0

expected = {java.sql.Time@14163} "20:59:56"
 jcal = null
 fastTime = 100796123
 cdate = {sun.util.calendar.Gregorian$Date@16957} "1970-01-01T20:59:56.123-0700"
 defaultCenturyStart = 0
noahkawasakigoogle commented 3 years ago

Oh nice, I have hit this issue on PrestoSQL/Trino versions 341+ when running some tests with timezones.

I saw there were a ton of timestamp related changes in that release and was thinking it was mostly from that.

I'll look into getting a simple SQL repro case. But I have seen this issue on 341 through 351.

Is this the type of thing that would get backported super far back? Or would the fix just go into the latest release when its handled?

findepi commented 3 years ago

Is this the type of thing that would get backported super far back? Or would the fix just go into the latest release when its handled?

There are no backport releases in Trino. All the bug fixes are going to be released in the next release, and we try to keep time between releases short, so it shouldn't matter.

I'll look into getting a simple SQL repro case.

Great!

It could perhaps be just

SELECT TIME '23.59.59.999999999999 +00:00'

?