File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -310,20 +310,22 @@ jsonpath_in(PG_FUNCTION_ARGS)
310
310
311
311
appendStringInfoSpaces (& buf , JSONPATH_HDRSZ );
312
312
313
- if (jsonpath ! = NULL )
313
+ if (jsonpath = = NULL )
314
314
{
315
- flattenJsonPathParseItem (& buf , jsonpath -> expr , false, false);
315
+ ereport (ERROR ,
316
+ (errcode (ERRCODE_INVALID_TEXT_REPRESENTATION ),
317
+ errmsg ("invalid input syntax for jsonpath: \"%s\"" , in )));
318
+ }
316
319
317
- res = (JsonPath * )buf .data ;
318
- SET_VARSIZE (res , buf .len );
319
- res -> header = JSONPATH_VERSION ;
320
- if (jsonpath -> lax )
321
- res -> header |= JSONPATH_LAX ;
320
+ flattenJsonPathParseItem (& buf , jsonpath -> expr , false, false);
322
321
323
- PG_RETURN_JSONPATH (res );
324
- }
322
+ res = (JsonPath * )buf .data ;
323
+ SET_VARSIZE (res , buf .len );
324
+ res -> header = JSONPATH_VERSION ;
325
+ if (jsonpath -> lax )
326
+ res -> header |= JSONPATH_LAX ;
325
327
326
- PG_RETURN_NULL ( );
328
+ PG_RETURN_JSONPATH ( res );
327
329
}
328
330
329
331
static void
You can’t perform that action at this time.
0 commit comments