From e0d0fa5b36dc1c7649a23f8aaa907130320df9ef Mon Sep 17 00:00:00 2001 From: Zhibai Song Date: Fri, 4 Aug 2023 00:19:51 +0000 Subject: [PATCH] [BABEL-4270] handle different behavior with escape character Babel should handle the difference between the default escape char '\' In PostgreSQL, '\' always is the default escape char while in Sql server ther's no such thing as default escape char unless a escape expression explicit shows the escape char. --- src/backend/utils/adt/like_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/adt/like_support.c b/src/backend/utils/adt/like_support.c index 1f22808bd30..17db7f4b554 100644 --- a/src/backend/utils/adt/like_support.c +++ b/src/backend/utils/adt/like_support.c @@ -1069,7 +1069,7 @@ like_fixed_prefix(Const *patt_const, bool case_insensitive, Oid collation, break; /* Backslash escapes the next character */ - if (patt[pos] == '\\') + if (patt[pos] == '\\' && sql_dialect != SQL_DIALECT_TSQL) { pos++; if (pos >= pattlen)