Eli Mesika has posted comments on this change. Change subject: setup: checking if command_entities table exist ......................................................................
Patch Set 6: (2 comments) http://gerrit.ovirt.org/#/c/37422/6/packaging/setup/dbutils/taskcleaner.sh File packaging/setup/dbutils/taskcleaner.sh: Line 297: Line 298: dbfunc_psql_die --command="${CMD1}${CMD2}" Line 299: Line 300: if [[ $VERSION = "3.4" ]]; then Line 301: dbfunc_psql_die --command="drop table command_entities cascade;" TWS Line 302: fi http://gerrit.ovirt.org/#/c/37422/6/packaging/setup/dbutils/taskcleaner_sp.sql File packaging/setup/dbutils/taskcleaner_sp.sql: Line 58: GET DIAGNOSTICS deleted_rows = ROW_COUNT; Line 59: IF deleted_rows > 0 THEN Line 60: DELETE FROM command_entities C WHERE command_id = root_command_id_of_deleted_cmds AND NOT EXISTS (SELECT * from COMMAND_ENTITIES WHERE root_command_id = C.command_id); Line 61: END IF; Line 62: END IF; The following code is the same (up to a parameter) , so I prefer not duplicating it , rather, please encapsulate it in a function and call it with the relevant parameters : --- snip--- DELETE FROM command_entities where command_id = v_command_id; GET DIAGNOSTICS deleted_rows = ROW_COUNT; IF deleted_rows > 0 THEN DELETE FROM command_entities C WHERE command_id = root_command_id_of_deleted_cmds AND NOT EXISTS (SELECT * from COMMAND_ENTITIES WHERE root_command_id = C.command_id); END IF; --- snip --- Line 63: END; $procedure$ Line 64: LANGUAGE plpgsql; Line 65: Line 66: CREATE OR REPLACE FUNCTION DeleteAsyncTasksZombies() RETURNS VOID -- To view, visit http://gerrit.ovirt.org/37422 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3152c4d3f6e02915053ada5019abeea7cb356751 Gerrit-PatchSet: 6 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: Eli Mesika <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[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
