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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: a59c795) | patch
Handle integer overflow in interval justification functions.
2022年2月28日 20:36:54 +0000 (15:36 -0500)
2022年2月28日 20:36:54 +0000 (15:36 -0500)
commit 54bd1e43ca56e323aef309dc2dc0e1391825ce68
Handle integer overflow in interval justification functions.

justify_interval, justify_hours, and justify_days didn't check for
overflow when promoting hours to days or days to months; but that's
possible when the upper field's value is already large. Detect and
report any such overflow.

Also, we can avoid unnecessary overflow in some cases in justify_interval
by pre-justifying the days field. (Thanks to Nathan Bossart for this
idea.)

Joe Koshakow

Discussion: https://postgr.es/m/CAAvxfHeNqsJ2xYFbPUf_8nNQUiJqkag04NW6aBQQ0dbZsxfWHA@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 によって変換されたページ (->オリジナル) /