This is an automated email from the ASF dual-hosted git repository.

jhyde pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new a86bca8c3e Revert [CALCITE-6180] Append possibility to escape 
backslash in LIKE with ESCAPE operator
a86bca8c3e is described below

commit a86bca8c3e8aa134eb0f416e91f699be02b7d20c
Author: Julian Hyde <[email protected]>
AuthorDate: Tue Jan 9 12:15:11 2024 -0800

    Revert [CALCITE-6180] Append possibility to escape backslash in LIKE with 
ESCAPE operator
---
 core/src/main/java/org/apache/calcite/runtime/Like.java            | 3 ---
 testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/core/src/main/java/org/apache/calcite/runtime/Like.java 
b/core/src/main/java/org/apache/calcite/runtime/Like.java
index 865efcc8d3..ac074afa3d 100644
--- a/core/src/main/java/org/apache/calcite/runtime/Like.java
+++ b/core/src/main/java/org/apache/calcite/runtime/Like.java
@@ -96,9 +96,6 @@ public class Like {
             || (nextChar == escapeChar)) {
           javaPattern.append(nextChar);
           i++;
-        } else if (nextChar == '\\') {
-          javaPattern.append("\\\\");
-          i++;
         } else {
           throw invalidEscapeSequence(sqlPattern, i);
         }
diff --git a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java 
b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
index 09311731dd..c393a0f848 100644
--- a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
+++ b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
@@ -3606,9 +3606,6 @@ public class SqlOperatorTest {
   @Test void testLikeEscape() {
     final SqlOperatorFixture f = fixture();
     f.setFor(SqlStdOperatorTable.LIKE, VmName.EXPAND);
-    f.checkBoolean("'a\\c' like 'a#\\c' escape '#'", true);
-    f.checkBoolean("'a\\\\c' like 'a#\\c' escape '#'", false);
-    f.checkBoolean("'a\\c' like 'a#\\\\c' escape '#'", false);
     f.checkBoolean("'a_c' like 'a#_c' escape '#'", true);
     f.checkBoolean("'axc' like 'a#_c' escape '#'", false);
     f.checkBoolean("'a_c' like 'a\\_c' escape '\\'", true);

Reply via email to