]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Clarify the ra != rb case in compareJsonbContainers().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 15 Jul 2025 22:21:12 +0000 (18:21 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 15 Jul 2025 22:21:12 +0000 (18:21 -0400)
commit2a3a3964328a0b6b0cb278ae6cb595772586d654
tree41409e531d8b7803724683c0af76f427730c052d
parentaad1617b76aef034a27f2a52903702dc5435c422
Clarify the ra != rb case in compareJsonbContainers().

It's impossible to reach this case with either ra or rb being
WJB_DONE, because our earlier checks that the structure and
length of the inputs match should guarantee that we reach their
ends simultaneously.  However, the comment completely fails to
explain this, and the Asserts don't cover it either.  The comment
is pretty obscure anyway, so rewrite it, and extend the Asserts
to reject WJB_DONE.

This is only cosmetic, so no need for back-patch.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/0c623e8a204187b87b4736792398eaf1@postgrespro.ru
src/backend/utils/adt/jsonb_util.c