Index: openacs-4/packages/acs-kernel/acs-kernel.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/acs-kernel.info,v diff -u -r1.150.2.23 -r1.150.2.24 --- openacs-4/packages/acs-kernel/acs-kernel.info 5 Mar 2020 17:56:59 -0000 1.150.2.23 +++ openacs-4/packages/acs-kernel/acs-kernel.info 14 Mar 2020 19:01:42 -0000 1.150.2.24 @@ -9,15 +9,15 @@ f t - + OpenACS Core Team Routines and data models providing the foundation for OpenACS-based Web services. 2017-08-06 OpenACS The OpenACS kernel contains the core datamodel create and drop scripts for such things as objects, groups, parties and the supporting PL/SQL and PL/pgSQL procedures. 3 - + Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql,v diff -u -r1.36.2.2 -r1.36.2.3 --- openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 4 Sep 2019 16:44:22 -0000 1.36.2.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 14 Mar 2020 19:01:42 -0000 1.36.2.3 @@ -1199,37 +1199,40 @@ select define_function_args('acs_group__member_p','party_id,group_id,cascade_membership'); -- --- procedure acs_group__member_p/3 +-- function acs_group__member_p/3 -- CREATE OR REPLACE FUNCTION acs_group__member_p( p_party_id integer, p_group_id integer, p_cascade_membership boolean ) RETURNS boolean AS $$ -DECLARE -BEGIN - if p_cascade_membership then + + SELECT CASE + WHEN p_cascade_membership = true then -- -- Direct and indirect memberships -- - return count(*) > 0 - from group_member_map + EXISTS ( + select 1 from group_member_map where group_id = p_group_id - and member_id = p_party_id; - else + and member_id = p_party_id + ) + ELSE -- -- Only direct memberships -- - return count(*) > 0 - from acs_rels rels - where rels.rel_type = 'membership_rel' - and rels.object_id_one = p_group_id - and rels.object_id_two = p_party_id; - end if; -END; -$$ LANGUAGE plpgsql stable; + EXISTS ( + select 1 from acs_rels rels + where rels.rel_type = 'membership_rel' + and rels.object_id_one = p_group_id + and rels.object_id_two = p_party_id + ) + END; +$$ LANGUAGE sql strict stable; + + -- function check_representation Index: openacs-4/packages/acs-kernel/sql/postgresql/site-nodes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/site-nodes-create.sql,v diff -u -r1.30.2.1 -r1.30.2.2 --- openacs-4/packages/acs-kernel/sql/postgresql/site-nodes-create.sql 25 Feb 2019 12:29:08 -0000 1.30.2.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/site-nodes-create.sql 14 Mar 2020 19:01:42 -0000 1.30.2.2 @@ -290,23 +290,22 @@ CREATE OR REPLACE FUNCTION site_node__url( url__node_id integer ) RETURNS varchar AS $$ - BEGIN - return ( With RECURSIVE site_nodes_recursion(parent_id, path, directory_p, node_id) as ( + + WITH RECURSIVE site_nodes_path(parent_id, path, directory_p, node_id) as ( select parent_id, ARRAY[name || case when directory_p then '/' else ' ' end]::text[] as path, directory_p, node_id from site_nodes where node_id = url__node_id UNION ALL select sn.parent_id, sn.name::text || snr.path , sn.directory_p, snr.parent_id - from site_nodes sn join site_nodes_recursion snr on sn.node_id = snr.parent_id + from site_nodes sn join site_nodes_path snr on sn.node_id = snr.parent_id where snr.parent_id is not null - ) select array_to_string(path,'/') from site_nodes_recursion where parent_id is null - ); - END; - $$ LANGUAGE plpgsql; + ) select array_to_string(path,'/') from site_nodes_path where parent_id is null + $$ LANGUAGE sql strict stable; + -- recursive site_nodes END ELSE Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.10.0d26-5.10.0d27.sql'. Fisheye: No comparison available. Pass `N' to diff?