Fix IsValidJsonNumber() to notice trailing non-alphanumeric garbage. Commit e09996ff8dee3f70 was one brick shy of a load: it didn't insist that the detected JSON number be the whole of the supplied string. This allowed inputs such as "2016-01-01" to be misdetected as valid JSON numbers. Per bug #13906 from Dmitry Ryabov.
In passing, be more wary of zero-length input (I'm not sure this can happen given current callers, but better safe than sorry), and do some minor cosmetic cleanup. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/1f2b195ebf1c1646b20111f1c339fbaebb04da56 Modified Files -------------- contrib/hstore/expected/hstore.out | 8 +++--- contrib/hstore/sql/hstore.sql | 2 +- src/backend/utils/adt/json.c | 52 ++++++++++++++++++++++++-------------- 3 files changed, 38 insertions(+), 24 deletions(-) -- Sent via pgsql-committers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
