Skip to content

Commit 6689909

Browse files
committed
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.
1 parent 9edf72a commit 6689909

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/utils/adt/jsonpath.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,8 @@ jspGetNext(JsonPathItem *v, JsonPathItem *a)
962962
v->type == jpiCeiling ||
963963
v->type == jpiDouble ||
964964
v->type == jpiKeyValue ||
965-
v->type == jpiStartsWith);
965+
v->type == jpiStartsWith ||
966+
v->type == jpiLikeRegex);
966967

967968
if (a)
968969
jspInitByBuffer(a, v->base, v->nextPos);

0 commit comments

Comments
 (0)