Eli Mesika has posted comments on this change.

Change subject: core: Remove error message when reports.xml doesn't exist
......................................................................


Patch Set 4:

(2 comments)

http://gerrit.ovirt.org/#/c/25324/4/packaging/dbscripts/common_sp.sql
File packaging/dbscripts/common_sp.sql:

Line 554:     RETURN;
Line 555: END; $procedure$
Line 556: LANGUAGE plpgsql;
Line 557: 
Line 558: -- Remove a value from a CSV string in vdc_options 
Please remove TWS
Line 559: Create or replace FUNCTION fn_vdc_remove_spv_value(v_option_name 
varchar, v_value varchar)
Line 560: returns void
Line 561: AS $procedure$
Line 562: BEGIN


Line 563:       UPDATE vdc_options SET 
option_value=replace(option_value,v_value || ',','') WHERE 
option_name=v_option_name;
Line 564:       UPDATE vdc_options SET option_value=replace(option_value,',' || 
v_value,'') WHERE option_name=v_option_name;
Line 565:       UPDATE vdc_options SET option_value='' WHERE 
option_value=v_value AND option_name=v_option_name;
Line 566: END; $procedure$
Line 567: LANGUAGE plpgsql;
The following function is more general it uses also the version provided and 
doing only one update. it can be done easier in PG 9.x , but we should support 
8.4 as well so will do that in the hard way. 
I had also changed the name to match other functions working on vdc_options

Create or replace FUNCTION fn_db_remove_csv_config_value(v_option_name 
varchar(100), v_value varchar(4000), v_version varchar(40))
returns void
AS $procedure$
DECLARE
v varchar[];
e varchar;
v_csv_val varchar;
v_result varchar;
v_sep varchar(1);
BEGIN
v_result := '';
v_sep := '';
    v := string_to_array(option_value, ',') from vdc_options where option_name 
= v_option_name and version = v_version;
    FOREACH e in ARRAY v
    LOOP
        IF (e != v_value) THEN
            v_result := v_result || v_sep || e;
            v_sep := ',';
        END IF;
    END LOOP;
    UPDATE vdc_options set option_value = v_result where option_name = 
v_option_name and version = v_version;
END; $procedure$
LANGUAGE plpgsql;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaf6b075eb4754c5bb4153da8c6032a01bf801516
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yaniv Dary <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to