Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bba4cf3

Browse files
author
Nikita Glukhov
committed
Fix jsonpath .** in strict mode
1 parent 14deee5 commit bba4cf3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/utils/adt/jsonpath_exec.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,11 @@ recursiveAny(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb,
10281028
v.type != jbvBinary)) /* leaves only requested */
10291029
{
10301030
/* check expression */
1031+
bool ignoreStructuralErrors = cxt->ignoreStructuralErrors;
1032+
1033+
cxt->ignoreStructuralErrors = true;
10311034
res = recursiveExecuteNext(cxt, NULL, jsp, &v, found, true);
1035+
cxt->ignoreStructuralErrors = ignoreStructuralErrors;
10321036

10331037
if (jperIsError(res))
10341038
break;
@@ -1653,7 +1657,11 @@ recursiveExecuteNoUnwrap(JsonPathExecContext *cxt, JsonPathItem *jsp,
16531657
/* first try without any intermediate steps */
16541658
if (jsp->content.anybounds.first == 0)
16551659
{
1660+
bool ignoreStructuralErrors = cxt->ignoreStructuralErrors;
1661+
1662+
cxt->ignoreStructuralErrors = true;
16561663
res = recursiveExecuteNext(cxt, jsp, &elem, jb, found, true);
1664+
cxt->ignoreStructuralErrors = ignoreStructuralErrors;
16571665

16581666
if (res == jperOk && !found)
16591667
break;

0 commit comments

Comments
 (0)