git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2360) Why doesn't Like.sqlToRegexSimilar(String sqlPattern,char escapeChar) translate "." into "\\."?


winifredtang created CALCITE-2360:
-------------------------------------

             Summary: Why doesn't Like.sqlToRegexSimilar(String sqlPattern,char escapeChar) translate "." into "\\."?
                 Key: CALCITE-2360
                 URL: https://issues.apache.org/jira/browse/CALCITE-2360
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.16.0
            Reporter: winifredtang
            Assignee: Julian Hyde


org.apache.calcite.runtime.SqlFunctions.similar function call Like.sqlToRegexSimilar(String sqlPattern,char escapeChar) to translate SQL SIMILAR pattern to Java regex pattern. "." in SQL SIMILAR pattern is not a metacharacter, but when Like.sqlToRegexSimilar translates it to Java regex pattern, it becomes a metacharacter. 
For example, in SQL SIMILAR pattern, only string "ab." can match the pattern "ab.", but the result of org.apache.calcite.runtime.SqlFunctions.similar("ab1", "ab.") can also ruturn ture.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-calcite-development/msg03739.html on line 91
Call Stack
#TimeMemoryFunctionLocation
10.0007363768{main}( ).../msg03739.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-calcite-development/msg03739.html on line 91
Call Stack
#TimeMemoryFunctionLocation
10.0007363768{main}( ).../msg03739.html:0