Allon Mureinik has posted comments on this change.

Change subject: engine: Manage Gluster hooks support
......................................................................


Patch Set 22: (1 inline comment)

....................................................
File backend/manager/dbscripts/gluster_hooks_sp.sql
Line 27: 
Line 28: 
Line 29: 
Line 30: Create or replace FUNCTION GetGlusterHookById(v_id UUID,
Line 31:                                               v_includeContent 
BOOLEAN=false)
As far as I can see, the difference between these two queries is whether we 
return content or null in the "content" field.

Eli - I can't quite think of a way to do this with a view. Can you give an 
example?

But even if we stick to the approach presented here, why use an if and two 
practically identical queries instead of an inline case statement?

RETURN QUERY SELECT id, cluster_id, gluster_command, stage, name,
ook_status, content_type, checksum, 
CASE v_includeContent WHEN true THEN content ELSE null::text END as content, 
conflict_status,
_create_date, _update_date
FROM  gluster_hooks
WHERE id = v_id;
Line 32: RETURNS SETOF gluster_hooks
Line 33: AS $procedure$
Line 34: BEGIN
Line 35:     if (v_includeContent = true) then


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If8b2d261ead720fccea6884acbc806ec79e52b36
Gerrit-PatchSet: 22
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Selvasundaram <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Selvasundaram <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to