pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Properly detect invalid JSON numbers when generating JSON.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Properly detect invalid JSON numbers when generating JSON.
@ 2013-12-27 22:21  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrew Dunstan @ 2013-12-27 22:21 UTC (permalink / raw)
  To: pgsql-committers

Properly detect invalid JSON numbers when generating JSON.

Instead of looking for characters that aren't valid in JSON numbers, we
simply pass the output string through the JSON number parser, and if it
fails the string is quoted. This means among other things that money and
domains over money will be quoted correctly and generate valid JSON.

Fixes bug #8676 reported by Anderson Cristian da Silva.

Backpatched to 9.2 where JSON generation was introduced.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4825a9e95fbc11f2edcdd9dbaba08f10d257596f

Modified Files
--------------
src/backend/utils/adt/json.c |   36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Properly detect invalid JSON numbers when generating JSON.
@ 2013-12-27 22:22  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrew Dunstan @ 2013-12-27 22:22 UTC (permalink / raw)
  To: pgsql-committers

Properly detect invalid JSON numbers when generating JSON.

Instead of looking for characters that aren't valid in JSON numbers, we
simply pass the output string through the JSON number parser, and if it
fails the string is quoted. This means among other things that money and
domains over money will be quoted correctly and generate valid JSON.

Fixes bug #8676 reported by Anderson Cristian da Silva.

Backpatched to 9.2 where JSON generation was introduced.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/7dfd9f6f54de39b6d2d2ce52a2faf7c00310bc9d

Modified Files
--------------
src/backend/utils/adt/json.c |   38 +++++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 15 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Properly detect invalid JSON numbers when generating JSON.
@ 2013-12-27 22:22  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrew Dunstan @ 2013-12-27 22:22 UTC (permalink / raw)
  To: pgsql-committers

Properly detect invalid JSON numbers when generating JSON.

Instead of looking for characters that aren't valid in JSON numbers, we
simply pass the output string through the JSON number parser, and if it
fails the string is quoted. This means among other things that money and
domains over money will be quoted correctly and generate valid JSON.

Fixes bug #8676 reported by Anderson Cristian da Silva.

Backpatched to 9.2 where JSON generation was introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/29dcf7ded5ef8533376689a85c5b242fc7ace01d

Modified Files
--------------
src/backend/utils/adt/json.c |   38 +++++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 15 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2013-12-27 22:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-12-27 22:21 pgsql: Properly detect invalid JSON numbers when generating JSON. Andrew Dunstan <andrew@dunslane.net>
2013-12-27 22:22 pgsql: Properly detect invalid JSON numbers when generating JSON. Andrew Dunstan <andrew@dunslane.net>
2013-12-27 22:22 pgsql: Properly detect invalid JSON numbers when generating JSON. Andrew Dunstan <andrew@dunslane.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox