Moti Asayag has uploaded a new change for review.

Change subject: engine: Do not fail on upgrade from 3.2 to 3.3
......................................................................

engine: Do not fail on upgrade from 3.2 to 3.3

In case there are more than one VM or template configured
for port mirroring, the inner stored procedure used to
fail. The patch modifies the STP to support network with
several VMs or Templates using port mirroring.

Change-Id: I1b995dcde32ddf99b841bbddb19edf67d7061731
Bug-Url: https://bugzilla.redhat.com/1013341
Signed-off-by: Moti Asayag <masa...@redhat.com>
---
M packaging/dbscripts/upgrade/03_03_0710_add_profile_to_network_interface.sql
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/47/19647/1

diff --git 
a/packaging/dbscripts/upgrade/03_03_0710_add_profile_to_network_interface.sql 
b/packaging/dbscripts/upgrade/03_03_0710_add_profile_to_network_interface.sql
index e0f29b64..4f96975 100644
--- 
a/packaging/dbscripts/upgrade/03_03_0710_add_profile_to_network_interface.sql
+++ 
b/packaging/dbscripts/upgrade/03_03_0710_add_profile_to_network_interface.sql
@@ -29,7 +29,7 @@
 Create or replace FUNCTION 
__temp_has_port_mirroring_vm_interfaces(v_network_id UUID) RETURNS BOOLEAN
    AS $procedure$
 BEGIN
-   RETURN ((SELECT 1
+   RETURN ((SELECT COUNT(1)
    FROM vm_interface
    INNER JOIN vm_static
    ON vm_static.vm_guid = vm_interface.vm_guid
@@ -39,14 +39,14 @@
    ON network.id = network_cluster.network_id
    AND network.name = vm_interface.network_name
    WHERE network.id = v_network_id
-   AND port_mirroring = TRUE) IS NOT NULL);
+   AND port_mirroring = TRUE) > 0);
 END; $procedure$
 LANGUAGE plpgsql;
 
 Create or replace FUNCTION 
__temp_has_port_mirroring_template_interfaces(v_network_id UUID) RETURNS BOOLEAN
    AS $procedure$
 BEGIN
-   RETURN ((SELECT 1
+   RETURN ((SELECT COUNT(1)
    FROM vm_interface
    INNER JOIN vm_static
    ON vm_static.vm_guid = vm_interface.vmt_guid
@@ -56,7 +56,7 @@
    ON network.id = network_cluster.network_id
    AND network.name = vm_interface.network_name
    WHERE network.id = v_network_id
-   AND port_mirroring = TRUE) IS NOT NULL);
+   AND port_mirroring = TRUE) > 0);
 END; $procedure$
 LANGUAGE plpgsql;
 


-- 
To view, visit http://gerrit.ovirt.org/19647
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b995dcde32ddf99b841bbddb19edf67d7061731
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to