Fix treatment of nulls in jsonb_agg and jsonb_object_agg

Andrew Dunstan <andrew@dunslane.net>

Commit: 016f28ad3dbf3bec14319cf2a49925b0063251aa
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2015-07-24T13:47:27Z
Releases: 9.5.0
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.

Files