From 4ed4bb585080f0eeedb04a512bf193268e16e9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tem=C3=A5?= <63051187+tema-mazy@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:49:34 +0200 Subject: [PATCH] Update StringUtils.java BUG: in non ANSI mode ' -> '' should be ' -> \' --- src/main/core-api/java/com/mysql/cj/util/StringUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/core-api/java/com/mysql/cj/util/StringUtils.java b/src/main/core-api/java/com/mysql/cj/util/StringUtils.java index 7dd47d1fc..6bda0273a 100644 --- a/src/main/core-api/java/com/mysql/cj/util/StringUtils.java +++ b/src/main/core-api/java/com/mysql/cj/util/StringUtils.java @@ -1766,7 +1766,11 @@ public static StringBuilder escapeString(StringBuilder buf, String x, boolean us buf.append('\\'); break; case '\'': - buf.append('\''); + if (useAnsiQuotedIdentifiers) { + buf.append('\''); + } else { + buf.append('\\'); + } buf.append('\''); break; case '"': /* Better safe than sorry */