diff --git a/procedures/retrieveEntityParents.sql b/procedures/retrieveEntityParents.sql index ffd9f13799b066c251b3941ffb8438e283014ebc..2b826b4fdc1600df3b14f9fcfa535c115f96d923 100644 --- a/procedures/retrieveEntityParents.sql +++ b/procedures/retrieveEntityParents.sql @@ -54,9 +54,18 @@ ACL : CREATE PROCEDURE db_2_0.retrieveEntityParents(in EntityID INT UNSIGNED) BEGIN -SELECT parent AS ParentID, name AS ParentName, description AS ParentDescription, role AS ParentRole, (SELECT acl from entity_acl as a WHERE a.id=e.acl) AS ACL FROM isa_cache AS i JOIN entities AS e ON (i.parent=e.id AND i.child=EntityID and i.rpath=EntityID); - +SELECT DISTINCT + parent AS ParentID, + name AS ParentName, + description AS ParentDescription, + role AS ParentRole, + (SELECT acl FROM entity_acl AS a WHERE a.id=e.acl) AS ACL + FROM + isa_cache AS i + JOIN + entities AS e + ON (i.parent=e.id AND i.child=EntityID AND i.rpath=EntityID); END //