pgsql: Fix hstore_to_json_loose's detection of valid JSON number values

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix hstore_to_json_loose's detection of valid JSON number values
Date: 2014-12-01 16:52:26
Message-ID: E1XvUD4-0005mK-Vk@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix hstore_to_json_loose's detection of valid JSON number values.

We expose a function IsValidJsonNumber that internally calls the lexer
for json numbers. That allows us to use the same test everywhere,
instead of inventing a broken test for hstore conversions. The new
function is also used in datum_to_json, replacing the code that is now
moved to the new function.

Backpatch to 9.3 where hstore_to_json_loose was introduced.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f82132f4a15e2a02d984b3ba0ef5b10da1f489bd

Modified Files
--------------
contrib/hstore/hstore_io.c | 43 ++-----------------------------
src/backend/utils/adt/json.c | 57 +++++++++++++++++++++++++++---------------
src/include/utils/jsonapi.h | 7 ++++++
3 files changed, 46 insertions(+), 61 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2014-12-01 16:52:36 pgsql: Fix hstore_to_json_loose's detection of valid JSON number values
Previous Message Andrew Dunstan 2014-12-01 16:52:13 pgsql: Fix hstore_to_json_loose's detection of valid JSON number values