]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix the fastpath rule for jsonb_concat with an empty operand.
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 13 Sep 2015 21:06:45 +0000 (17:06 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 13 Sep 2015 21:14:46 +0000 (17:14 -0400)
commitf243072a9ca3d135745441ab016996a00d183bd2
treef66a19b5c373fcd5d719ff637e28006100ced542
parent63c0f5b20b7012633bbd85cea039e9d44c054953
Fix the fastpath rule for jsonb_concat with an empty operand.

To prevent perverse results, we now only return the other operand if
it's not scalar, and if both operands are of the same kind (array or
object).

Original bug complaint and patch from Oskari Saarenmaa, extended by me
to cover the cases of different kinds of jsonb.

Backpatch to 9.5 where jsonb_concat was introduced.
src/backend/utils/adt/jsonfuncs.c
src/test/regress/expected/jsonb.out
src/test/regress/expected/jsonb_1.out
src/test/regress/sql/jsonb.sql