pgsql: Handle integer overflow in interval justification functions.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Handle integer overflow in interval justification functions.
Дата
Msg-id E1nOmlR-000Kpi-Km@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/54bd1e43ca56e323aef309dc2dc0e1391825ce68

Modified Files
--------------
src/backend/utils/adt/timestamp.c      | 35 +++++++++++++++++++++++++++++----
src/test/regress/expected/interval.out | 36 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/interval.sql      | 12 ++++++++++++
3 files changed, 79 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Allow root-owned SSL private keys in libpq, not only the backend
Следующее
От: Amit Kapila
Дата:
Сообщение: pgsql: Reconsider pg_stat_subscription_workers view.