summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath.c
diff options
context:
space:
mode:
authorDavid Rowley2023-08-01 13:39:47 +0000
committerDavid Rowley2023-08-01 13:39:47 +0000
commitdeae1657ee6dd6f7b3effab3d44429d5434f5bbf (patch)
tree9853b737fb528bf345505867008b3a06a117e21b /src/backend/utils/adt/jsonpath.c
parentd3a38318ac614f20a9e2e163bba083d15be54f06 (diff)
Fix overly strict Assert in jsonpath code
This was failing for queries which try to get the .type() of a jpiLikeRegex. For example: select jsonb_path_query('["string", "string"]', '($[0] like_regex ".{7}").type()'); Reported-by: Alexander Kozhemyakin Bug: #18035 Discussion: https://postgr.es/m/[email protected] Backpatch-through: 12, where SQL/JSON path was added.
Diffstat (limited to 'src/backend/utils/adt/jsonpath.c')
-rw-r--r--src/backend/utils/adt/jsonpath.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/utils/adt/jsonpath.c b/src/backend/utils/adt/jsonpath.c
index 7891fde3105..c5ba3b7f1d0 100644
--- a/src/backend/utils/adt/jsonpath.c
+++ b/src/backend/utils/adt/jsonpath.c
@@ -1014,7 +1014,8 @@ jspGetNext(JsonPathItem *v, JsonPathItem *a)
v->type == jpiDouble ||
v->type == jpiDatetime ||
v->type == jpiKeyValue ||
- v->type == jpiStartsWith);
+ v->type == jpiStartsWith ||
+ v->type == jpiLikeRegex);
if (a)
jspInitByBuffer(a, v->base, v->nextPos);