CLOUDSTACK-2303: upgrade failed from 2.2.14 to 4.1.0 - part2 Signed-off-by: Chip Childers <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a3a5c134 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a3a5c134 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a3a5c134 Branch: refs/heads/ui-cisco-asa1000v-support Commit: a3a5c13427d6871f87da291425314b18ef64fa2a Parents: c8e3fff Author: Wei Zhou <[email protected]> Authored: Fri May 3 16:01:44 2013 +0100 Committer: Chip Childers <[email protected]> Committed: Fri May 3 16:03:56 2013 +0100 ---------------------------------------------------------------------- .../src/com/cloud/upgrade/dao/Upgrade2214to30.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3a5c134/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java index 817231f..2d77429 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade2214to30.java @@ -630,7 +630,7 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade { //XenServer try { //Get 3.0.0 or later xenserer system Vm template Id - pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name like 'systemvm-xenserver-%' and removed is null"); + pstmt = conn.prepareStatement("select max(id) from `cloud`.`vm_template` where name like 'systemvm-xenserver-%' and removed is null"); rs = pstmt.executeQuery(); if(rs.next()){ long templateId = rs.getLong(1); @@ -661,7 +661,7 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade { s_logger.debug("Updating KVM System Vms"); try { //Get 3.0.0 or later KVM system Vm template Id - pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name like 'systemvm-kvm-%' and removed is null"); + pstmt = conn.prepareStatement("select max(id) from `cloud`.`vm_template` where name like 'systemvm-kvm-%' and removed is null"); rs = pstmt.executeQuery(); if(rs.next()){ long templateId = rs.getLong(1); @@ -692,7 +692,7 @@ public class Upgrade2214to30 extends Upgrade30xBase implements DbUpgrade { s_logger.debug("Updating VMware System Vms"); try { //Get 3.0.0 or later VMware system Vm template Id - pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name like 'systemvm-vmware-%' and removed is null"); + pstmt = conn.prepareStatement("select max(id) from `cloud`.`vm_template` where name like 'systemvm-vmware-%' and removed is null"); rs = pstmt.executeQuery(); if(rs.next()){ long templateId = rs.getLong(1);
