You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksey Plekhanov (Jira)" <ji...@apache.org> on 2021/08/12 09:15:00 UTC
[jira] [Commented] (IGNITE-15004) Calcite engine. LIKE ESCAPE fails
with empty escape string
[ https://issues.apache.org/jira/browse/IGNITE-15004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17397946#comment-17397946 ]
Aleksey Plekhanov commented on IGNITE-15004:
--------------------------------------------
Some vendors don't support empty escape characters too (for example Oracle) and it's not a bug from the Calcite point of view (there is explicit check for length == 1), but our current H2 engine support it, and some other RDBMS support it (PostgreSQL, MySQL).
> 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
> Priority: Major
>
> {{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)