File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -221,15 +221,8 @@ jsonb_typeof(PG_FUNCTION_ARGS)
221
221
PG_RETURN_TEXT_P (cstring_to_text (result ));
222
222
}
223
223
224
- /*
225
- * jsonb_from_cstring
226
- *
227
- * Turns json string into a jsonb Datum.
228
- *
229
- * Uses the json parser (with hooks) to construct a jsonb.
230
- */
231
- static inline Datum
232
- jsonb_from_cstring (char * json , int len )
224
+ static JsonbValue *
225
+ JsonValueFromCString (char * json , int len )
233
226
{
234
227
JsonLexContext * lex ;
235
228
JsonbInState state ;
@@ -251,9 +244,21 @@ jsonb_from_cstring(char *json, int len)
251
244
pg_parse_json (lex , & sem );
252
245
253
246
/* after parsing, the item member has the composed jsonb structure */
254
- PG_RETURN_JSONB ( JsonbValueToJsonb ( state .res )) ;
247
+ return state .res ;
255
248
}
256
249
250
+ /*
251
+ * jsonb_from_cstring
252
+ *
253
+ * Turns json string into a jsonb Datum.
254
+ *
255
+ * Uses the json parser (with hooks) to construct a jsonb.
256
+ */
257
+ static inline Datum
258
+ jsonb_from_cstring (char * json , int len )
259
+ {
260
+ PG_RETURN_JSONB (JsonbValueToJsonb (JsonValueFromCString (json , len )));
261
+ }
257
262
258
263
static void
259
264
jsonb_in_object_start (void * pstate )
You can’t perform that action at this time.
0 commit comments