git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: fbf9a7a) | patch
Catch overflow when rounding intervals in AdjustIntervalForTypmod.
2024年2月13日 20:58:40 +0000 (15:58 -0500)
2024年2月13日 20:58:40 +0000 (15:58 -0500)
commit 5ebc9c90173f32cffe373a80835f157b9ebfa3bd
Catch overflow when rounding intervals in AdjustIntervalForTypmod.

Previously, an interval microseconds field close to INT64_MAX or
INT64_MIN could overflow, producing a result with not even the
correct sign, while being rounded to match a precision specification.

This seems worth fixing, but not worth back-patching, in part
because the ereturn() notation doesn't exist very far back.

Report and patch by Joseph Koshakow (some cosmetic mods by me)

Discussion: https://postgr.es/m/CAAvxfHfpuLgqJYzkUcher466Z1LpmE+5Sm+zc8L6zKCOQ+6TDQ@mail.gmail.com
src/backend/utils/adt/timestamp.c diff | blob | blame | history
src/test/regress/expected/interval.out diff | blob | blame | history
src/test/regress/sql/interval.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /