Skip to content

v26.2.13

@shghasemi shghasemi tagged this 02 Dec 23:45
pgjdbc 42.7.15 qualifies the operators in its catalog queries, e.g.
`n.nspname OPERATOR(pg_catalog.~~) ?`, which failed to parse: the
scanner lexes `~~`, `~~*`, `!~~` and `!~~*` as the LIKE, ILIKE, NOT LIKE
and NOT ILIKE keywords, and OPERATOR() did not accept them.

OPERATOR() now accepts these operators. A binary use is parsed into a
parenthesized plain LIKE expression, so the formatted form keeps the
tighter precedence of OPERATOR(), which differs from PostgreSQL. The
ANY/ALL form, e.g. `a OPERATOR(pg_catalog.~~) ANY (...)`, is parsed into
a plain `a LIKE ANY (...)`. As in PostgreSQL, the keyword spellings such
as OPERATOR(LIKE) are still rejected.

The LIKE alternatives of subquery_op are moved into a like_op rule, to
contrast with the new operator_like_op rule; this does not change
behavior.

Fixes: cockroachlabs/cockroach#17558

Release note (bug fix): Fixed a bug where the LIKE operators `~~`,
`~~*`, `!~~` and `!~~*` could not be used in the OPERATOR() syntax,
e.g. `OPERATOR(pg_catalog.~~)`, causing a syntax error. This broke
catalog queries in pgjdbc 42.7.15, including those used by Hibernate's
schema validation.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Assets 2
Loading