You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/03/10 00:39:38 UTC
[jira] [Resolved] (CALCITE-1674) LIKE Operator with % does not
match when column contains newline
[ https://issues.apache.org/jira/browse/CALCITE-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde resolved CALCITE-1674.
----------------------------------
Resolution: Fixed
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/58217cb2. Thanks for the PR, [~markap14]!
> LIKE Operator with % does not match when column contains newline
> ----------------------------------------------------------------
>
> Key: CALCITE-1674
> URL: https://issues.apache.org/jira/browse/CALCITE-1674
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Mark Payne
> Assignee: Julian Hyde
> Fix For: 1.12.0
>
>
> If I have a column where some rows contain a newline, then using a % does not match as it should. For example, if I have a column named 'foo' where a row contains 'My\nValue' then the following query I would expect to match:
> SELECT * FROM MyTable WHERE foo LIKE 'M%'
> However, this row is not returned by the above query. This appears to be a bug in the regex generated by the org.apache.calcite.runtime.Like class, as it generates '.*' for the %, but in Java the dot character does not match newlines unless it is compiled in dot-all mode.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)