trinodb/trino
Voir sur GitHubINTERVAL `x` SECOND values with `x` having >3 digits of decimal precision are silently truncated
Open
#6 754 ouverte le 29 janv. 2021
good first issue
Métriques du dépôt
- Stars
- (9 113 stars)
- Métriques de merge PR
- (Merge moyen 5j 9h) (306 PRs mergées en 30 j)
Description
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.