Skip to content

Commit deae165

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 d3a3831 commit deae165

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
@@ -1014,7 +1014,8 @@ jspGetNext(JsonPathItem *v, JsonPathItem *a)
10141014
v->type == jpiDouble ||
10151015
v->type == jpiDatetime ||
10161016
v->type == jpiKeyValue ||
1017-
v->type == jpiStartsWith);
1017+
v->type == jpiStartsWith ||
1018+
v->type == jpiLikeRegex);
10181019

10191020
if (a)
10201021
jspInitByBuffer(a, v->base, v->nextPos);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy