summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-08-02 01:40:56 +1200
committerDavid Rowley <drowley@postgresql.org>2023-08-02 01:40:56 +1200
commit67f3a697ba83489fc69fefd82bc6dbc19f87ac56 (patch)
treede6ad345fd69c6173cdd8c846d81c489dca18bbf /src/backend/utils/adt/jsonpath.c
parentd1ef5631e620f9a5b6480a32bb70124c857af4f1 (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/18035-64af5cdcb5adf2a9@postgresql.org 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 91af0300952..f9210441df5 100644
--- a/src/backend/utils/adt/jsonpath.c
+++ b/src/backend/utils/adt/jsonpath.c
@@ -982,7 +982,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);