ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject git commit: AMBARI-5252. Upgrade (Oracle as Ambari DB): AddHost wizard fails with server error. (swagle)
Date Thu, 27 Mar 2014 20:58:09 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 65106ab5a -> c06183ba7


AMBARI-5252. Upgrade (Oracle as Ambari DB): AddHost wizard fails with server error. (swagle)


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

Branch: refs/heads/trunk
Commit: c06183ba713b8c7c8c4dee858b66f3e633e8646d
Parents: 65106ab
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Thu Mar 27 13:58:04 2014 -0700
Committer: Siddharth Wagle <swagle@hortonworks.com>
Committed: Thu Mar 27 13:58:04 2014 -0700

----------------------------------------------------------------------
 .../apache/ambari/server/upgrade/UpgradeCatalog150.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c06183ba/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
index 8c8a9ba..7b28ff2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog150.java
@@ -261,16 +261,16 @@ public class UpgradeCatalog150 extends AbstractUpgradeCatalog {
 
     if (dbType.equals(Configuration.POSTGRES_DB_NAME)) {
       if (dbAccessor.tableExists("hostcomponentdesiredconfigmapping")) {
-        dbAccessor.executeQuery("ALTER TABLE hostcomponentdesiredconfigmapping rename to
hcdesiredconfigmapping;", true);
+        dbAccessor.executeQuery("ALTER TABLE hostcomponentdesiredconfigmapping rename to
hcdesiredconfigmapping", true);
       }
-      dbAccessor.executeQuery("ALTER TABLE users ALTER column user_id DROP DEFAULT;", true);
-      dbAccessor.executeQuery("ALTER TABLE users ALTER column ldap_user TYPE INTEGER USING
CASE WHEN ldap_user=true THEN 1 ELSE 0 END;", true);
+      dbAccessor.executeQuery("ALTER TABLE users ALTER column user_id DROP DEFAULT", true);
+      dbAccessor.executeQuery("ALTER TABLE users ALTER column ldap_user TYPE INTEGER USING
CASE WHEN ldap_user=true THEN 1 ELSE 0 END", true);
     }
 
     if (Configuration.ORACLE_DB_NAME.equals(dbType) ||
         Configuration.POSTGRES_DB_NAME.equals(dbType)) {
       if (dbAccessor.tableHasColumn("hosts", "disks_info")) {
-        dbAccessor.executeQuery("ALTER TABLE hosts DROP COLUMN disks_info;", true);
+        dbAccessor.executeQuery("ALTER TABLE hosts DROP COLUMN disks_info", true);
       }
     }
 
@@ -285,7 +285,7 @@ public class UpgradeCatalog150 extends AbstractUpgradeCatalog {
       moveRCATableInMySQL("hdfsEvent", dbName);
       moveRCATableInMySQL("mapreduceEvent", dbName);
       moveRCATableInMySQL("clusterEvent", dbName);
-      dbAccessor.executeQuery("DROP DATABASE IF EXISTS ambarirca;");
+      dbAccessor.executeQuery("DROP DATABASE IF EXISTS ambarirca");
     }
 
     //Newly created tables should be filled before creating FKs
@@ -382,7 +382,7 @@ public class UpgradeCatalog150 extends AbstractUpgradeCatalog {
 
   private void moveRCATableInMySQL(String tableName, String dbName) throws SQLException {
     if (!dbAccessor.tableExists(tableName)) {
-      dbAccessor.executeQuery(String.format("RENAME TABLE ambarirca.%s TO %s.%s;", tableName,
dbName, tableName), true);
+      dbAccessor.executeQuery(String.format("RENAME TABLE ambarirca.%s TO %s.%s", tableName,
dbName, tableName), true);
     }
   }
 


Mime
View raw message