Repository: ambari Updated Branches: refs/heads/branch-1.5.0 46d802ca0 -> ec7f572d4
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/ec7f572d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ec7f572d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ec7f572d Branch: refs/heads/branch-1.5.0 Commit: ec7f572d4a380a4caf2a100469f68a23a998ad25 Parents: 46d802c Author: Siddharth Wagle <swa...@hortonworks.com> Authored: Thu Mar 27 13:49:05 2014 -0700 Committer: Siddharth Wagle <swa...@hortonworks.com> Committed: Thu Mar 27 13:49:05 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/ec7f572d/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); } }