File tree 1 file changed +15
-10
lines changed
1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -251,15 +251,8 @@ jsonb_typeof(PG_FUNCTION_ARGS)
251
251
PG_RETURN_TEXT_P (cstring_to_text (result ));
252
252
}
253
253
254
- /*
255
- * jsonb_from_cstring
256
- *
257
- * Turns json string into a jsonb Datum.
258
- *
259
- * Uses the json parser (with hooks) to construct a jsonb.
260
- */
261
- static inline Datum
262
- jsonb_from_cstring (char * json , int len )
254
+ static JsonbValue *
255
+ JsonValueFromCString (char * json , int len )
263
256
{
264
257
JsonLexContext * lex ;
265
258
JsonbInState state ;
@@ -281,9 +274,21 @@ jsonb_from_cstring(char *json, int len)
281
274
pg_parse_json_or_ereport (lex , & sem );
282
275
283
276
/* after parsing, the item member has the composed jsonb structure */
284
- PG_RETURN_JSONB_P ( JsonbValueToJsonb ( state .res )) ;
277
+ return state .res ;
285
278
}
286
279
280
+ /*
281
+ * jsonb_from_cstring
282
+ *
283
+ * Turns json string into a jsonb Datum.
284
+ *
285
+ * Uses the json parser (with hooks) to construct a jsonb.
286
+ */
287
+ static inline Datum
288
+ jsonb_from_cstring (char * json , int len )
289
+ {
290
+ PG_RETURN_JSONB_P (JsonbValueToJsonb (JsonValueFromCString (json , len )));
291
+ }
287
292
288
293
static void
289
294
jsonb_in_object_start (void * pstate )
You can’t perform that action at this time.
0 commit comments