sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2726: Sqoop2: Integration Tests: Do not use ansi_quotes mode for MySQL
Date Tue, 15 Dec 2015 08:20:28 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 16c2cdcab -> d35efd3c3


SQOOP-2726: Sqoop2: Integration Tests: Do not use ansi_quotes mode for MySQL

(Abraham Fine via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: d35efd3c3a229f01afb9ac5982c8bed65c977e18
Parents: 16c2cdc
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Dec 15 09:19:43 2015 +0100
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Dec 15 09:19:43 2015 +0100

----------------------------------------------------------------------
 .../sqoop/common/test/db/MySQLProvider.java       | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/d35efd3c/common-test/src/main/java/org/apache/sqoop/common/test/db/MySQLProvider.java
----------------------------------------------------------------------
diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/db/MySQLProvider.java
b/common-test/src/main/java/org/apache/sqoop/common/test/db/MySQLProvider.java
index 393904f..229e8c4 100644
--- a/common-test/src/main/java/org/apache/sqoop/common/test/db/MySQLProvider.java
+++ b/common-test/src/main/java/org/apache/sqoop/common/test/db/MySQLProvider.java
@@ -34,7 +34,7 @@ public class MySQLProvider extends DatabaseProvider {
 
   private static final String CONNECTION = System.getProperties().getProperty(
     "sqoop.provider.mysql.jdbc",
-    "jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true&sessionVariables=sql_mode='ANSI_QUOTES'"
+    "jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true"
   );
 
   private static final String USERNAME = System.getProperties().getProperty(
@@ -64,16 +64,16 @@ public class MySQLProvider extends DatabaseProvider {
 
   @Override
   public String escapeColumnName(String columnName) {
-    return escape(columnName);
+    return escapeName(columnName);
   }
 
   @Override
   public String escapeTableName(String tableName) {
-    return escape(tableName);
+    return escapeName(tableName);
   }
 
   public String escapeDatabaseName(String databaseName) {
-    return escape(databaseName);
+    return escapeName(databaseName);
   }
 
   // the scheme name is the same as database name.
@@ -84,7 +84,7 @@ public class MySQLProvider extends DatabaseProvider {
 
   @Override
   public String escapeValueString(String value) {
-    return escape(value);
+    return escapeValue(value);
   }
 
   @Override
@@ -109,7 +109,11 @@ public class MySQLProvider extends DatabaseProvider {
     }
   }
 
-  public String escape(String entity) {
-    return "\"" + entity + "\"";
+  public String escapeName(String entity) {
+    return "`" + entity + "`";
+  }
+
+  public String escapeValue(String entity) {
+    return "\'" + entity + "\'";
   }
 }


Mime
View raw message