]> 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:47:27 +0000 (09:47 -0400)
commit016f28ad3dbf3bec14319cf2a49925b0063251aa
treea9ed79e71762b0cae90619d4e2fb89e1da260479
parentbb0203f26fa5f09fe2689a9db4bc632c1435edec
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