web/modules/rhn/RHN/DB/DataSource/xml/SystemGroup_queries.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
New commits: commit d64ea81ab324d8d7bd3211093d03267f3dcbbb73 Author: Michael Mraka michael.mraka@redhat.com Date: Fri Aug 12 11:24:52 2011 +0200
removed unnecessary join
well, rhnVisServerGroupMembership.group_type already is rhnServerGroupType.label so no need to join the table again, moreover condition group_type (aka group label) = id is completely wrong
fixing numeric vs. varchar issue
diff --git a/web/modules/rhn/RHN/DB/DataSource/xml/SystemGroup_queries.xml b/web/modules/rhn/RHN/DB/DataSource/xml/SystemGroup_queries.xml index c928831..a26e1d8 100644 --- a/web/modules/rhn/RHN/DB/DataSource/xml/SystemGroup_queries.xml +++ b/web/modules/rhn/RHN/DB/DataSource/xml/SystemGroup_queries.xml @@ -115,13 +115,11 @@ ORDER BY UPPER(GROUP_NAME), GO.GROUP_ID <query params="sid, org_id, user_id"> SELECT VSGM.group_id AS ID, SG.name AS GROUP_NAME, - SGT.label AS GROUP_TYPE_LABEL, + VSGM.group_type AS GROUP_TYPE_LABEL, (SELECT 1 FROM rhnUserServerGroupPerms WHERE user_id = :user_id AND server_group_id = SG.id) AS USER_PERMITTED_ACCESS FROM rhnServerGroup SG, - rhnVisServerGroupMembership VSGM - LEFT JOIN rhnServerGroupType SGT - ON VSGM.group_type = SGT.id, + rhnVisServerGroupMembership VSGM, rhnUserServerGroupPerms USGP WHERE VSGM.org_id = :org_id AND VSGM.server_id = :sid