You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Qilong Wang (Jira)" <ji...@apache.org> on 2026/04/06 13:27:00 UTC
[jira] [Created] (FLINK-39402) Fix LIKE quick path ignoring default escape character '\'
Qilong Wang created FLINK-39402:
-----------------------------------
Summary: Fix LIKE quick path ignoring default escape character '\'
Key: FLINK-39402
URL: https://issues.apache.org/jira/browse/FLINK-39402
Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Affects Versions: 2.3.0
Reporter: Qilong Wang
Fix For: 2.3.0
The LIKE expression uses \ as the default escape character when no ESCAPE clause is specified. However, the escaped \_ and \% behave inconsistently:
-- '\' escapes '_' to match a literal '_' — correct
SELECT 'TE_ST' LIKE 'TE\_ST' -- TRUE
-- '\' escapes '%' to match a literal '%' — should be TRUE, but returns FALSE
SELECT 'TE%ST' LIKE 'TE\%ST' -- FALSE
Both \_ and \% should be treated as escaped literals under the default escape character \. The fix unifies escape handling so that \% is correctly recognized as a literal %, consistent with \_.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)