Fix JSON_OBJECTAGG uniquefying bug
authorAndrew Dunstan <[email protected]>
Thu, 28 Apr 2022 19:28:20 +0000 (15:28 -0400)
committerAndrew Dunstan <[email protected]>
Thu, 28 Apr 2022 19:28:20 +0000 (15:28 -0400)
commit9c3d25e17894f35045a2d57dfb834e25c9dc4c21
tree565c218bd4bbe06e0814c487e174ded76b89000e
parent5c854e7a2c8a6cd26040e0f9949e7a4a007f6366
Fix JSON_OBJECTAGG uniquefying bug

Commit f4fb45d15c contained a bug in removing items with null values when
unique keys are required, where the leading items that are sorted
contained such values. Fix that and add a test for it.

Discussion: https://postgr.es/m/CAJA4AWQ_XbSmsNbW226UqNyRLJ+wb=iQkQMj77cQyoNkqtf=2Q@mail.gmail.com
src/backend/utils/adt/jsonb_util.c
src/test/regress/expected/sqljson.out
src/test/regress/sql/sqljson.sql