Skip to content

Commit

Permalink
Revert [CALCITE-6180] Append possibility to escape backslash in LIKE …
Browse files Browse the repository at this point in the history
…with ESCAPE operator
  • Loading branch information
julianhyde committed Jan 9, 2024
1 parent 3deb77c commit a86bca8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions core/src/main/java/org/apache/calcite/runtime/Like.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ static String sqlToRegexLike(
|| (nextChar == escapeChar)) {
javaPattern.append(nextChar);
i++;
} else if (nextChar == '\\') {
javaPattern.append("\\\\");
i++;
} else {
throw invalidEscapeSequence(sqlPattern, i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3606,9 +3606,6 @@ static void checkRlikeFails(SqlOperatorFixture f) {
@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);
Expand Down

0 comments on commit a86bca8

Please sign in to comment.