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

Missing bound checks for time AT TIME ZONE interval #9288

Open
findepi opened this issue Sep 17, 2021 · 0 comments
Open

Missing bound checks for time AT TIME ZONE interval #9288

findepi opened this issue Sep 17, 2021 · 0 comments
Labels
bug Something isn't working correctness

Comments

@findepi
Copy link
Member

findepi commented Sep 17, 2021

Integer overflow:

trino> SELECT TIME '01:23:45' AT TIME ZONE INTERVAL '1024' MINUTE;
     _col0
----------------
 16:27:45-17:04

we should also disallow:

trino> SELECT TIME '01:23:45' AT TIME ZONE INTERVAL '841' MINUTE;
     _col0
----------------
 13:24:45+14:01

because the offset 14:01 is beyond [-14:00, 14:00] reserved in TimeZoneKey and thus such time with time zone values cannot be fully supported in other parts of the code

trino> SELECT CAST(TIME '01:23:45' AT TIME ZONE INTERVAL '841' MINUTE AS timestamp with time zone);
Query 20210917_123847_00038_v8rf7 failed: Invalid offset minutes 841

cc @martint @losipiuk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness
Development

No branches or pull requests

1 participant