prestodb/presto

Presto allows parsing of invalid timezone names

オープン

#21,461 opened on 2023/11/30

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)Java (5,240 件のフォーク)batch import
buggood first issue

Repository metrics

Stars
 (15,558 個のスター)
PR merge metrics
 (平均マージ 34d 14h) (30d で 120 merged PRs)

説明

Presto's timezone parsing is too permissive and allows for timezone names that are not valid according to IANA's timezone database, in addition to other bugs:

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

The following are examples of non-compliant timezone names that are allowed:

ETC/+06:00
ETC/+06
ETC/+6
ETC/UTC*
ETC/UT*

-> the only official formats are "ETC/GMT+1" and similar

EST

-> not supported, but it should be

timezones in the format:

ETC/GMT+10:00

besides not being official, return the wrong result (don't flip the sign as they should)

+1
+01

officially also don't exist (only "+01:00")

Expected Behavior

These should fail to parse, though it might break backwards compatibility.

Current Behavior

They are parsed successfully (incorrectly).

Steps to Reproduce

presto> select from_unixtime(1698528090, 'ETC/+06:00');
             _col0              
--------------------------------
 2023-10-29 03:21:30.000 +06:00 

and other variations described above.

Cc: @mbasmanova @zacw7

コントリビューターガイド