sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2130: BaseSqoopTestCase should use manager.escapeTable instead of directly hardcoding double quotes
Date Wed, 25 Feb 2015 03:12:42 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk 1c3d0efe2 -> 653668f0f


SQOOP-2130: BaseSqoopTestCase should use manager.escapeTable instead of directly hardcoding
double quotes

(Jarek Jarcec Cecho via Abraham Elmahrek)


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

Branch: refs/heads/trunk
Commit: 653668f0f6c74225c66e100989717a5152253188
Parents: 1c3d0ef
Author: Abraham Elmahrek <abe@apache.org>
Authored: Tue Feb 24 18:07:45 2015 -0800
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Tue Feb 24 18:07:45 2015 -0800

----------------------------------------------------------------------
 src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/653668f0/src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java b/src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java
index cc5cbd7..7934791 100644
--- a/src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java
+++ b/src/test/com/cloudera/sqoop/testutil/BaseSqoopTestCase.java
@@ -281,7 +281,7 @@ public abstract class BaseSqoopTestCase extends TestCase {
   protected void dropTableIfExists(String table) throws SQLException {
     Connection conn = getManager().getConnection();
     PreparedStatement statement = conn.prepareStatement(
-        "DROP TABLE \"" + table + "\" IF EXISTS",
+        "DROP TABLE " + manager.escapeTableName(table) + " IF EXISTS",
         ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
     try {
       statement.executeUpdate();
@@ -322,7 +322,7 @@ public abstract class BaseSqoopTestCase extends TestCase {
           }
         }
 
-        createTableStr = "CREATE TABLE \"" + getTableName() + "\"(" + columnDefStr + ")";
+        createTableStr = "CREATE TABLE " + manager.escapeTableName(getTableName()) + "("
+ columnDefStr + ")";
         LOG.info("Creating table: " + createTableStr);
         statement = conn.prepareStatement(
             createTableStr,
@@ -356,7 +356,7 @@ public abstract class BaseSqoopTestCase extends TestCase {
           }
         }
         try {
-          String insertValsStr = "INSERT INTO \"" + getTableName() + "\"(" + columnListStr
+ ")"
+          String insertValsStr = "INSERT INTO " + manager.escapeTableName(getTableName())
+ "(" + columnListStr + ")"
               + " VALUES(" + valueListStr + ")";
           LOG.info("Inserting values: " + insertValsStr);
           statement = conn.prepareStatement(


Mime
View raw message