Taras Ledkov created IGNITE-15004:
-------------------------------------

             Summary: Calcite engine. LIKE ESCAPE fails with empty escape string
                 Key: IGNITE-15004
                 URL: https://issues.apache.org/jira/browse/IGNITE-15004
             Project: Ignite
          Issue Type: Bug
          Components: sql
            Reporter: Taras Ledkov


{{SELECT '%_' LIKE '%_' ESCAPE ''}}

error:
{code}
class org.apache.ignite.IgniteException: Unexpected exception
        at 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext.lambda$execute$0(ExecutionContext.java:244)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.QueryTaskExecutorImpl.lambda$execute$0(QueryTaskExecutorImpl.java:68)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Invalid escape character ''
        at org.apache.calcite.runtime.Like.invalidEscapeCharacter(Like.java:104)
        at org.apache.calcite.runtime.Like.sqlToRegexLike(Like.java:56)
        at org.apache.calcite.runtime.SqlFunctions.like(SqlFunctions.java:594)
        at SC.execute(Unknown Source)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl$ProjectImpl.apply(ExpressionFactoryImpl.java:387)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ProjectNode.push(ProjectNode.java:63)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:107)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext.lambda$execute$0(ExecutionContext.java:239)
        ... 4 more
{code}

Test:
{{function/string/test_like_escape.test}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to