Skip to content

Commit 9606619

Browse files
committed
Remove unnecessary check for jbvBinary in convertJsonbValue.
The check was confusing and is a condition that should never in fact happen. Per gripe from Dmitry Dolgov.
1 parent 6680224 commit 9606619

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/utils/adt/jsonb_util.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,14 @@ convertJsonbValue(StringInfo buffer, JEntry *header, JsonbValue *val, int level)
13141314
if (!val)
13151315
return;
13161316

1317-
if (IsAJsonbScalar(val) || val->type == jbvBinary)
1317+
/*
1318+
* A JsonbValue passed as val should never have a type of jbvBinary,
1319+
* and neither should any of its sub-components. Those values will be
1320+
* produced by convertJsonbArray and convertJsonbObject, the results of
1321+
* which will not be passed back to this function as an argument.
1322+
*/
1323+
1324+
if (IsAJsonbScalar(val))
13181325
convertJsonbScalar(buffer, header, val);
13191326
else if (val->type == jbvArray)
13201327
convertJsonbArray(buffer, header, val, level);

0 commit comments

Comments
 (0)