trinodb/trino

INTERVAL `x` SECOND values with `x` having >3 digits of decimal precision are silently truncated

Open

#6,754 建立於 2021年1月29日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)Java (2,678 fork)batch import
good first issue

倉庫指標

Star
 (9,113 star)
PR 合併指標
 (平均合併 5天 9小時) (30 天內合併 306 個 PR)

描述

minimal example:

presto:default> 
SELECT val + INTERVAL '.0001' second 
FROM (VALUES TIMESTAMP '2021-01-01 00:00:00.123456789 UTC') 
AS t (val);
               _col0
-----------------------------------
 2021-01-01 00:00:00.123456789 UTC
(1 row)

This is a really unfortunate bug as it results in silently incorrect data. Ideally the INTERVAL function could be patched to do the right thing here, but we'd also be ok if it would at least throw an error rather than return incorrect data.

貢獻者指南