empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From der...@apache.org
Subject empire-db git commit: EMPIREDB-184
Date Mon, 01 Aug 2016 06:24:23 GMT
Repository: empire-db
Updated Branches:
  refs/heads/master 9543cebfa -> e769f0f86


EMPIREDB-184

Project: http://git-wip-us.apache.org/repos/asf/empire-db/repo
Commit: http://git-wip-us.apache.org/repos/asf/empire-db/commit/e769f0f8
Tree: http://git-wip-us.apache.org/repos/asf/empire-db/tree/e769f0f8
Diff: http://git-wip-us.apache.org/repos/asf/empire-db/diff/e769f0f8

Branch: refs/heads/master
Commit: e769f0f8600f815b6d3848ab06dfc103fa4bd15d
Parents: 9543ceb
Author: Jan Glaubitz <jan@glaubitz.org>
Authored: Mon Aug 1 08:23:13 2016 +0200
Committer: Jan Glaubitz <jan@glaubitz.org>
Committed: Mon Aug 1 08:23:13 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/empire-db/blob/e769f0f8/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
----------------------------------------------------------------------
diff --git a/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
b/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
index 994c67b..b758b74 100644
--- a/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
+++ b/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
@@ -722,8 +722,10 @@ public class DBDatabaseDriverMySQL extends DBDatabaseDriver
     @Override
     protected void appendSQLTextValue(StringBuilder buf, String value)
     {
+    	boolean escape = false;
         if (value.indexOf('\'') >= 0)
         { // a routine to double up single quotes for SQL
+        	escape = true;
             int len = value.length();
             for (int i = 0; i < len; i++)
             {
@@ -735,6 +737,7 @@ public class DBDatabaseDriverMySQL extends DBDatabaseDriver
         }
         if (value.indexOf('\\') >= 0)
         { // a routine to double up backslashes for MySQL
+        	escape = true;
             int len = value.length();
             for (int i = 0; i < len; i++)
             {
@@ -744,8 +747,7 @@ public class DBDatabaseDriverMySQL extends DBDatabaseDriver
                     buf.append(value.charAt(i));
             }
         }
-        else
-        {
+        if (!escape) {
             buf.append(value);
         }
     }


Mime
View raw message