Browse Source

AMBARI-15737. Ambari DB schema upgrade fails with ORA-01408 error (aonishuk)

Andrew Onishuk 9 years ago
parent
commit
064f1d195e

+ 1 - 1
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog222.java

@@ -293,7 +293,7 @@ public class UpgradeCatalog222 extends AbstractUpgradeCatalog {
   }
 
   protected void updateHostRoleCommands() throws SQLException {
-    dbAccessor.createIndex("idx_hrc_status", "host_role_command", "status", "role");
+    dbAccessor.createIndex("idx_hrc_status_role", "host_role_command", "status", "role");
   }
 
   protected void updateAMSConfigs() throws AmbariException {

+ 1 - 1
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog222Test.java

@@ -585,7 +585,7 @@ public class UpgradeCatalog222Test {
   @Test
   public void testUpdateHostRoleCommands() throws Exception {
     final DBAccessor dbAccessor = createNiceMock(DBAccessor.class);
-    dbAccessor.createIndex(eq("idx_hrc_status"), eq("host_role_command"), eq("status"), eq("role"));
+    dbAccessor.createIndex(eq("idx_hrc_status_role"), eq("host_role_command"), eq("status"), eq("role"));
     expectLastCall().once();
 
     replay(dbAccessor);