cockroachdb / cockroachdb/cockroach

jsonpath: incorrect handling of `like_regex` with escape characters in pattern

Open
#145,270 5 comments 0 reactions 0 assignees View on GitHub
branch-master branch-release-25.2 C-bug T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Found via `pg_regress`.

```sql
-- we return 3 rows, PG returns 1 row
select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "a\\b")');
-- we return 0 rows, PG returns 1 row
select jsonb_path_query('[null, 1, "a\b", "a\\b", "^a\\b$"]', 'lax $[*] ? (@ like_regex "^a\\b$")');
```

Jira issue: CRDB-49819

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.