Skip to content

Commit c8c6a69

Browse files
committed
Revert "Add all structured objects passed to pushJsonbValue piecewise."
This reverts commit 54547bd. This appears to have been a thinko on my part. I will try to come up wioth a better solution.
1 parent 79f0f7c commit c8c6a69

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/backend/utils/adt/jsonb_util.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,8 @@ fillJsonbValue(JsonbContainer *container, int index,
509509
* "raw scalar" pseudo array to append it - the actual scalar should be passed
510510
* next and it will be added as the only member of the array.
511511
*
512-
* All non-scalar types (jvbBinary, jbvArray and jbvObject) passed as
513-
* elements or values are unpacked before being added to the result.
512+
* Values of type jvbBinary, which are rolled up arrays and objects,
513+
* are unpacked before being added to the result.
514514
*/
515515
JsonbValue *
516516
pushJsonbValue(JsonbParseState **pstate, JsonbIteratorToken seq,
@@ -522,18 +522,14 @@ pushJsonbValue(JsonbParseState **pstate, JsonbIteratorToken seq,
522522
JsonbIteratorToken tok;
523523

524524
if (!jbval || (seq != WJB_ELEM && seq != WJB_VALUE) ||
525-
IsAJsonbScalar(jbval))
525+
jbval->type != jbvBinary)
526526
{
527527
/* drop through */
528528
return pushJsonbValueScalar(pstate, seq, jbval);
529529
}
530530

531-
/* unpack the data and add each piece to the pstate */
532-
if (jbval->type == jbvBinary)
533-
it = JsonbIteratorInit(jbval->val.binary.data);
534-
else
535-
it = JsonbIteratorInit(jbval);
536-
531+
/* unpack the binary and add each piece to the pstate */
532+
it = JsonbIteratorInit(jbval->val.binary.data);
537533
while ((tok = JsonbIteratorNext(&it, &v, false)) != WJB_DONE)
538534
res = pushJsonbValueScalar(pstate, tok,
539535
tok < WJB_BEGIN_ARRAY ? &v : NULL);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy