cockroachdb / cockroachdb/cockroach
jsonpath: incorrect handling of `like_regex` with escape characters in pattern
Open
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
Assessment
This issue has not been assessed yet.