-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Validate time with time zone well-formedness #9280
Validate time with time zone well-formedness #9280
Conversation
1c8ac50
to
f6b1bdf
Compare
CI: |
if (picoseconds < 0 || picoseconds >= PICOSECONDS_PER_DAY) { | ||
throw new IllegalArgumentException("picoseconds is out of range: " + picoseconds); | ||
} | ||
// TIME WITH TIME ZONE's valid offsets are [-14:00, 14:00] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we enforce it already (just in a more ugly way during query processing). Or will some queries which used to work may start failing now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I checked literal form prior, but that's not enough. Filed #9288.
f6b1bdf
to
7b45344
Compare
core/trino-main/src/test/java/io/trino/type/TestTimeWithTimeZoneType.java
Outdated
Show resolved
Hide resolved
7b45344
to
d1257c2
Compare
d1257c2
to
2ef9875
Compare
@martint ptal |
1 similar comment
@martint ptal |
CI #8691 |
No, I think we can fix them independently. This provides an additional safety check for any place that constructs a SqlTimeWithTimeZone object |
i am thinking the same. |
For #5738