]> granicus.if.org Git - postgresql/commit
Fix treatment of nulls in jsonb_agg and jsonb_object_agg
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 24 Jul 2015 13:40:46 +0000 (09:40 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 24 Jul 2015 13:40:46 +0000 (09:40 -0400)
commitd9a356ff2e6bb7ed5fb1145af49fa3e51e68a98a
tree2320f3f55faa3d0e3c92f2b4a39d9f22dcaeda46
parentc1ca3a19df376bcbb6d651d15b9a4ffcaa377ff1
Fix treatment of nulls in jsonb_agg and jsonb_object_agg

The wrong is_null flag was being passed to datum_to_json. Also, null
object key values are not permitted, and this was not being checked
for. Add regression tests covering these cases, and also add those tests
to the json set, even though it was doing the right thing.

Fixes bug #13514, initially diagnosed by Tom Lane.
src/backend/utils/adt/jsonb.c
src/test/regress/expected/json.out
src/test/regress/expected/json_1.out
src/test/regress/expected/jsonb.out
src/test/regress/expected/jsonb_1.out
src/test/regress/sql/json.sql
src/test/regress/sql/jsonb.sql