Fix overflow problems in btree_gist's gbt_numeric_penalty(). For the same reasons as in 15b3dc140, we should avoid throwing overflow errors in the numeric opclass. Use numeric_sub_safe(), or numeric_sub_opt_error() in older branches, to avoid overflow of the numeric format; and handle Inf/NaN inputs explicitly to be sure we get desirable answers in those cases.
Author: Ewan Young <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/CAON2xHN4hdndi-b3H=x-wryrvblzcc2abmxfoqlnuba72zq...@mail.gmail.com Backpatch-through: 15 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3ee29a60253c9d68ebe057fc154f54f9cddeb51c Modified Files -------------- contrib/btree_gist/btree_numeric.c | 63 +++++++++++++++++++++++++++------ contrib/btree_gist/expected/numeric.out | 17 +++++++++ contrib/btree_gist/sql/numeric.sql | 13 +++++++ 3 files changed, 83 insertions(+), 10 deletions(-)
