Skip to content

fix(postgresql): support string concatenation in LIKE/regex right-hand side#2663

Open
nguyenmp wants to merge 1 commit into
taozhi8833998:masterfrom
tryretool:marknguyen/fix_str_concat_after_like_ilike
Open

fix(postgresql): support string concatenation in LIKE/regex right-hand side#2663
nguyenmp wants to merge 1 commit into
taozhi8833998:masterfrom
tryretool:marknguyen/fix_str_concat_after_like_ilike

Conversation

@nguyenmp
Copy link
Copy Markdown

@nguyenmp nguyenmp commented Jun 3, 2026

Example: SELECT * FROM Users WHERE email ILIKE '%' || '@example.com

The right-hand side of LIKE and regex operators used the ordered choice (literal / comparison_expr), so a leading literal matched and committed before the || concatenation chain could be parsed, e.g. col LIKE '%' || 'x' || '%' failed with "but '|' found".

Reorder the choice to (additive_expr / literal / comparison_expr) so the full expression (which handles ||) is attempted first. Add round-trip tests for LIKE/NOT LIKE/ESCAPE and regex concatenation.

…d side

The right-hand side of LIKE and regex operators used the ordered choice (literal / comparison_expr), so a leading literal matched and committed before the `||` concatenation chain could be parsed, e.g. `col LIKE '%' || 'x' || '%'` failed with "but '|' found".

Reorder the choice to (additive_expr / literal / comparison_expr) so the full expression (which handles `||`) is attempted first. Add round-trip tests for LIKE/NOT LIKE/ESCAPE and regex concatenation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant