@@ -313,7 +313,6 @@ static void JsonValueListInitIterator(const JsonValueList *jvl,
313
313
static JsonbValue * JsonValueListNext (const JsonValueList * jvl ,
314
314
JsonValueListIterator * it );
315
315
static int JsonbType (JsonbValue * jb );
316
- static JsonbValue * JsonbInitBinary (JsonbValue * jbv , Jsonb * jb );
317
316
static int JsonbType (JsonbValue * jb );
318
317
static JsonbValue * getScalar (JsonbValue * scalar , enum jbvType type );
319
318
static JsonbValue * wrapItemsInArray (const JsonValueList * items );
@@ -625,7 +624,7 @@ executeJsonPath(JsonPath *path, void *vars, JsonPathVarCallback getVar,
625
624
jspInit (& jsp , path );
626
625
627
626
if (!JsonbExtractScalar (& json -> root , & jbv ))
628
- JsonbInitBinary (& jbv , json );
627
+ JsonValueInitBinary (& jbv , JsonRoot ( json ) );
629
628
630
629
cxt .vars = vars ;
631
630
cxt .getVar = getVar ;
@@ -2093,7 +2092,7 @@ executeKeyValueMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
2093
2092
2094
2093
jsonb = JsonbValueToJsonb (keyval );
2095
2094
2096
- JsonbInitBinary (& obj , jsonb );
2095
+ JsonValueInitBinary (& obj , JsonRoot ( jsonb ) );
2097
2096
2098
2097
baseObject = setBaseObject (cxt , & obj , cxt -> lastGeneratedObjectId ++ );
2099
2098
@@ -2233,7 +2232,7 @@ getJsonPathVariableFromJsonb(void *varsJsonb, char *varName, int varNameLength,
2233
2232
* value = * v ;
2234
2233
pfree (v );
2235
2234
2236
- JsonbInitBinary (baseObject , vars );
2235
+ JsonValueInitBinary (baseObject , JsonRoot ( vars ) );
2237
2236
return 1 ;
2238
2237
}
2239
2238
@@ -2615,18 +2614,6 @@ JsonValueListNext(const JsonValueList *jvl, JsonValueListIterator *it)
2615
2614
return result ;
2616
2615
}
2617
2616
2618
- /*
2619
- * Initialize a binary JsonbValue with the given jsonb container.
2620
- */
2621
- static JsonbValue *
2622
- JsonbInitBinary (JsonbValue * jbv , Jsonb * jb )
2623
- {
2624
- jbv -> type = jbvBinary ;
2625
- jbv -> val .binary .data = & jb -> root ;
2626
-
2627
- return jbv ;
2628
- }
2629
-
2630
2617
/*
2631
2618
* Returns jbv* type of JsonbValue. Note, it never returns jbvBinary as is.
2632
2619
*/
@@ -3115,7 +3102,7 @@ JsonItemFromDatum(Datum val, Oid typid, int32 typmod, JsonbValue *res)
3115
3102
Assert (res );
3116
3103
}
3117
3104
else
3118
- JsonbInitBinary (jbv , jb );
3105
+ JsonValueInitBinary (jbv , JsonRoot ( jb ) );
3119
3106
break ;
3120
3107
}
3121
3108
case JSONOID :
0 commit comments