]> granicus.if.org Git - postgresql/commit
Prevent infinity and NaN in jsonb/plperl transform
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 30 Apr 2018 16:28:45 +0000 (12:28 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 30 Apr 2018 17:22:57 +0000 (13:22 -0400)
commite348e7ae5727a6da8678036d748e5c5af7deb6c9
treead29dc9987af244f9a240f05f9c1c44611ecd96e
parentf7df8043f08a9d00811fb4aa054ed3221f5f9b5e
Prevent infinity and NaN in jsonb/plperl transform

jsonb uses numeric internally, and numeric can store NaN, but that is
not allowed by jsonb on input, so we shouldn't store it.  Also prevent
infinity to get a consistent error message.  (numeric input would reject
infinity anyway.)

Reported-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
contrib/jsonb_plperl/expected/jsonb_plperl.out
contrib/jsonb_plperl/expected/jsonb_plperlu.out
contrib/jsonb_plperl/jsonb_plperl.c
contrib/jsonb_plperl/sql/jsonb_plperl.sql
contrib/jsonb_plperl/sql/jsonb_plperlu.sql