You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current SQL parser supports the LIKE clause, but it doesn't handle the ESCAPE keyword. In SQL, the ESCAPE keyword allows users to define a custom escape character for special symbols in pattern matching. This feature is important for parsing complex SQL queries that use custom escape characters in LIKE conditions.
Expected Behavior
The parser should correctly recognize and handle the ESCAPE keyword, allowing users to define custom escape characters in LIKE clauses.
Example1:default
WITH users AS (
SELECT'30'as name
UNION ALLSELECT'%30'
)
SELECT*FROM users WHERE name LIKE'%3%'
result
name
30
%30
Example2:escape
WITH users AS (
SELECT'30'as name
UNION ALLSELECT'%30'
)
SELECT*FROM users WHERE name LIKE'\%3%'
result
name
%30
Example3:escape custom
WITH users AS (
SELECT'30'as name
UNION ALLSELECT'%30'
)
SELECT*FROM users WHERE name LIKE'x%3%' escape 'x'
result
name
%30
Tasks
Modify the parser to recognize and process the ESCAPE keyword.
Add test cases to validate LIKE clauses with the ESCAPE keyword.
Description
The current SQL parser supports the LIKE clause, but it doesn't handle the ESCAPE keyword. In SQL, the ESCAPE keyword allows users to define a custom escape character for special symbols in pattern matching. This feature is important for parsing complex SQL queries that use custom escape characters in LIKE conditions.
Expected Behavior
The parser should correctly recognize and handle the ESCAPE keyword, allowing users to define custom escape characters in LIKE clauses.
Example1:default
result
Example2:escape
result
Example3:escape custom
result
Tasks
Modify the parser to recognize and process the ESCAPE keyword.
Add test cases to validate LIKE clauses with the ESCAPE keyword.
References
https://www.postgresql.jp/document/16/html/functions-matching.html
The text was updated successfully, but these errors were encountered: