prestodb/presto

Presto allows parsing of invalid timezone names

开放

#21,461 创建于 2023年11月30日

 (5 条评论) (0 个反应) (0 位负责人)Java (5,240 个派生)batch import
buggood first issue

仓库指标

星标
 (15,558 个星标)
PR 合并指标
 (平均合并 34天 14小时) (30 天内合并 120 个 PR)

描述

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

贡献者指南