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

Commit aeb8e3e

Browse files
author
Nikita Glukhov
committed
Fix jsonpath .** in strict mode
1 parent 5cb0ca9 commit aeb8e3e

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
@@ -1059,7 +1059,11 @@ recursiveAny(JsonPathExecContext *cxt, JsonPathItem *jsp, JsonbValue *jb,
10591059
v.type != jbvBinary)) /* leaves only requested */
10601060
{
10611061
/* check expression */
1062+
bool ignoreStructuralErrors = cxt->ignoreStructuralErrors;
1063+
1064+
cxt->ignoreStructuralErrors = true;
10621065
res = recursiveExecuteNext(cxt, NULL, jsp, &v, found, true);
1066+
cxt->ignoreStructuralErrors = ignoreStructuralErrors;
10631067

10641068
if (jperIsError(res))
10651069
break;
@@ -1683,7 +1687,11 @@ recursiveExecuteNoUnwrap(JsonPathExecContext *cxt, JsonPathItem *jsp,
16831687
/* first try without any intermediate steps */
16841688
if (jsp->content.anybounds.first == 0)
16851689
{
1690+
bool ignoreStructuralErrors = cxt->ignoreStructuralErrors;
1691+
1692+
cxt->ignoreStructuralErrors = true;
16861693
res = recursiveExecuteNext(cxt, jsp, &elem, jb, found, true);
1694+
cxt->ignoreStructuralErrors = ignoreStructuralErrors;
16871695

16881696
if (res == jperOk && !found)
16891697
break;

0 commit comments

Comments
 (0)