Index: openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql 15 May 2001 16:59:00 -0000 1.2
+++ openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.3
@@ -91,9 +91,10 @@
select ag.group_id as parent_group_id
from application_groups ag,
apm_packages,
- (select object_id, 1 as tree_rownum
- from site_nodes
- where tree_sortkey like (select tree_sortkey from site_nodes where node_id = :node_id) || '%') nodes
+ (select s.object_id, 1 as tree_rownum
+ from site_nodes s, site_nodes s2
+ where s2.node_id = :node_id
+ and s.tree_sortkey between s2.tree_sortkey and tree_right(s2.tree_sortkey)) nodes
where nodes.object_id = apm_packages.package_id
and apm_packages.package_id = ag.package_id
limit 1
Index: openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.3
+++ openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.4
@@ -43,11 +43,10 @@
v.enum_value, v.pretty_name as value_pretty_name
from acs_object_type_attributes a left outer join
acs_enum_values v using (attribute_id),
- (select t.object_type,
- tree_level(tree_sortkey) -
- (select tree_level(tree_sortkey) from acs_object_types where object_type = :start_with) as type_level
- from acs_object_types t
- where tree_sortkey like (select tree_sortkey from acs_object_types where object_type = :start_with) || '%') t
+ (select t.object_type, tree_level(t.tree_sortkey) - tree_level(t2.tree_sortkey) as type_level
+ from acs_object_types t, acs_object_types t2
+ where t2.object_type = :start_with
+ and t.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)) t
where a.object_type = :object_type
and t.object_type = a.ancestor_type $storage_clause
order by type_level, a.sort_order
Index: openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql 27 Nov 2001 06:08:49 -0000 1.7
+++ openacs-4/packages/acs-subsite/tcl/package-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.8
@@ -26,8 +26,7 @@
from acs_object_type_attributes attr,
(select t2.object_type, t2.table_name, (tree_level(t1.tree_sortkey) - tree_level(t2.tree_sortkey)) + 1 as type_level
from acs_object_types t1, acs_object_types t2
- where t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ where t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
and t1.object_type = :object_type) t
where attr.ancestor_type = t.object_type
and attr.object_type = :object_type
@@ -43,7 +42,7 @@
select t2.object_type
from acs_object_types t1, acs_object_types t2
where t2.dynamic_p = 't'
- and t2.tree_sortkey like (t1.tree_sortkey || '%')
+ and t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = :object_type
@@ -70,8 +69,7 @@
select t2.object_type as ancestor_type
from acs_object_types t1, acs_object_types t2
- where t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ where t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
and t1.object_type = :object_type
@@ -83,7 +81,7 @@
select t2.object_type as sub_type
from acs_object_types t1, acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = :object_type
@@ -126,11 +124,9 @@
t.id_column as object_type_id_column
from acs_object_type_attributes a,
(select t.object_type, t.table_name, t.id_column, tree_level(t.tree_sortkey) as type_level
- from acs_object_types t
- where tree_sortkey like
- (select tree_sortkey || '%'
- from acs_object_types
- where object_type = :start_with)) t
+ from acs_object_types t, acs_object_types t2
+ where t.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
+ and t2.object_type = :start_with) t
where a.object_type = :object_type
and t.object_type = a.ancestor_type $storage_clause
order by type_level, attribute_id
@@ -145,8 +141,7 @@
from user_tab_columns cols,
(select upper(t2.table_name) as table_name
from acs_object_types t1, acs_object_types t2
- where t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ where t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
and t1.object_type = :object_type) t
where cols.column_name in
(select args.arg_name
Index: openacs-4/packages/acs-subsite/tcl/party-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/party-procs-postgresql.xql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/tcl/party-procs-postgresql.xql 9 Sep 2001 16:34:56 -0000 1.5
+++ openacs-4/packages/acs-subsite/tcl/party-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.6
@@ -30,7 +30,7 @@
t2.tree_sortkey
from acs_object_types t1,
acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and $start_with_clause ) types
left outer join
(select object_type
Index: openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql 20 Aug 2001 05:15:28 -0000 1.4
+++ openacs-4/packages/acs-subsite/tcl/rel-types-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.5
@@ -21,12 +21,11 @@
select case when exists (select 1
- from acs_object_types t1, acs_object_types t2
- where t2.object_type not in (select g.rel_type
- from group_type_rels g
- where g.group_type = :group_type)
- and t1.object_type in ('membership_rel','composition_rel')
- and t2.tree_sortkey like t1.tree_sortkey || '%')
+ from acs_object_types t1, acs_object_types t2, group_type_rels g
+ where g.group_type = :group_type
+ and t2.object_type <> g.rel_type
+ and t1.object_type in ('membership_rel','composition_rel')
+ and t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey))
then 1 else 0 end
Index: openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql 9 Sep 2001 16:34:56 -0000 1.5
+++ openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.6
@@ -58,7 +58,7 @@
from
acs_object_types t1,
acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = :start_with) types left join
(select
rel_type
Index: openacs-4/packages/acs-subsite/tcl/subsite-callback-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-callback-procs-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/tcl/subsite-callback-procs-postgresql.xql 22 Jul 2001 17:28:40 -0000 1.2
+++ openacs-4/packages/acs-subsite/tcl/subsite-callback-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.3
@@ -11,7 +11,7 @@
where object_type in (select t2.object_type
from acs_object_types t1, acs_object_types t2
where t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ and t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
and t1.object_type = :object_type)
and event_type = :event_type
Index: openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql 15 Oct 2001 20:15:43 -0000 1.4
+++ openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.5
@@ -55,8 +55,7 @@
select t2.object_type
from acs_object_types t1, acs_object_types t2
where t1.object_type = :object_type
- and t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ and t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
order by t2.tree_sortkey desc
Index: openacs-4/packages/acs-subsite/www/admin/group-types/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/Attic/index-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/www/admin/group-types/index-postgresql.xql 28 Nov 2001 18:39:39 -0000 1.2
+++ openacs-4/packages/acs-subsite/www/admin/group-types/index-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.3
@@ -14,7 +14,7 @@
from acs_object_types t1,
acs_object_types t2
where t1.object_type = 'group'
- and t2.tree_sortkey like t1.tree_sortkey || '%') t
+ and t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)) t
left outer join
(select o.object_type, count(*) as number_groups
from groups g, acs_objects o,
Index: openacs-4/packages/acs-subsite/www/admin/group-types/new-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/new-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/www/admin/group-types/new-postgresql.xql 3 Aug 2001 21:09:20 -0000 1.2
+++ openacs-4/packages/acs-subsite/www/admin/group-types/new-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.3
@@ -19,7 +19,7 @@
select repeat(' ', (tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey)) * 4) || t2.pretty_name, t2.object_type
from acs_object_types t1, acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = 'group'
Index: openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql 15 May 2001 16:59:00 -0000 1.1
+++ openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.2
@@ -35,7 +35,7 @@
tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) + 1 as type_level
from acs_object_types t1, acs_object_types t2
where t1.object_type = 'group'
- and t2.tree_sortkey like t1.tree_sortkey || '%') t
+ and t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)) t
where a.object_type = :group_type
and t.object_type = a.ancestor_type
order by type_level
Index: openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.3
+++ openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.4
@@ -11,7 +11,7 @@
from (select t2.pretty_name, t2.object_type as rel_type, tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) + 1 as type_level
from acs_object_types t1,
acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t2.object_type not in (select g.rel_type
from group_type_rels g
where g.group_type = :group_type)
Index: openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql 7 Sep 2001 20:57:20 -0000 1.5
+++ openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.6
@@ -12,8 +12,7 @@
and object_type in (
select t2.object_type
from acs_object_types t1, acs_object_types t2
- where t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ where t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
and t1.object_type = :rel_type
)
Index: openacs-4/packages/acs-subsite/www/admin/groups/new-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/new-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-subsite/www/admin/groups/new-postgresql.xql 15 May 2001 16:59:00 -0000 1.1
+++ openacs-4/packages/acs-subsite/www/admin/groups/new-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.2
@@ -13,8 +13,7 @@
select t2.object_type
from acs_object_types t1, acs_object_types t2
where t1.object_type = :add_with_rel_type
- and t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ and t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
)
Index: openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.3
+++ openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.4
@@ -10,11 +10,11 @@
t.pretty_name, t.rel_type
from (select t2.pretty_name, t2.object_type as rel_type, tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) + 1 as type_level
from acs_object_types t1,
- acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
- and t2.object_type not in (select g.rel_type
- from group_rels g
- where g.group_id = :group_id)
+ acs_object_types t2,
+ group_rels g
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
+ and t2.object_type <> g.rel_type
+ and g.group_id = :group_id
and t1.object_type in ('membership_rel', 'composition_rel')) t,
acs_rel_types rel_type
where t.rel_type = rel_type.rel_type
Index: openacs-4/packages/acs-subsite/www/admin/parties/new-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/parties/new-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-subsite/www/admin/parties/new-postgresql.xql 15 May 2001 16:59:00 -0000 1.1
+++ openacs-4/packages/acs-subsite/www/admin/parties/new-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.2
@@ -6,16 +6,11 @@
- select object_type as ancestor_rel_type
- from acs_object_types
- where supertype = 'relationship'
- and object_type in (
- select t2.object_type
- from acs_object_types t1, acs_object_types t2
- where t1.object_type = :add_with_rel_type
- and t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
- )
+ select t2.object_type as ancestor_rel_type
+ from acs_object_types t1, acs_object_types t2
+ where t1.object_type = :add_with_rel_type
+ and t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
+ and t2.supertype = 'relationship'
Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.3
+++ openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.4
@@ -8,10 +8,12 @@
select t2.pretty_name, t2.object_type as rel_type,
repeat(' ', (tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey)) * 4) as indent
from acs_object_types t1,
- acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ acs_object_types t2,
+ rel_segments s
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type in ('membership_rel', 'composition_rel')
- and t2.object_type not in (select s.rel_type from rel_segments s where s.group_id = :group_id)
+ and t2.object_type <> s.rel_type
+ and s.group_id = :group_id
order by lower(t2.pretty_name) desc
Index: openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql 9 Sep 2001 16:34:56 -0000 1.3
+++ openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.4
@@ -11,7 +11,7 @@
repeat(' ', (tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey)) * 4) as indent
from acs_object_types t1,
acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type in ('membership_rel', 'composition_rel')) t left join
(select r.rel_type, count(*) as number_relationships
from acs_objects o, acs_rel_types r,
Index: openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql 9 Sep 2001 15:36:44 -0000 1.4
+++ openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.5
@@ -10,7 +10,7 @@
t2.object_type as rel_type
from acs_object_types t1,
acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = :max_object_type_one
@@ -24,7 +24,7 @@
t2.object_type as rel_type
from acs_object_types t1,
acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = :max_object_type_two
Index: openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql 9 Sep 2001 17:10:41 -0000 1.4
+++ openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.5
@@ -10,7 +10,7 @@
t2.object_type
from acs_object_types t1,
acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type in ('membership_rel', 'composition_rel')
Index: openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/Attic/add-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql 11 Aug 2001 21:31:03 -0000 1.2
+++ openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql 4 Dec 2001 00:20:47 -0000 1.3
@@ -41,9 +41,9 @@
p.party_id
from (select o.object_id as party_id
from acs_objects o,
- (select object_type from acs_object_types
+ (select object_type from acs_object_types ot
start with $start_with
- connect by prior object_type = supertype) t
+ connect by prior ot.object_type = ot.supertype) t
where o.object_type = t.object_type) p,
(select element_id
from group_element_map
Index: openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/Attic/add-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2
+++ openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.3
@@ -18,8 +18,7 @@
select t2.object_type from
acs_object_types t1, acs_object_types t2
where t1.object_type= :rel_type
- and t2.tree_sortkey <= t1.tree_sortkey
- and t1.tree_sortkey like (t2.tree_sortkey || '%')
+ and t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
)
@@ -44,10 +43,9 @@
p.party_id
from (select o.object_id as party_id
from acs_objects o,
- (select object_type from acs_object_types
- where tree_sortkey like (select tree_sortkey || '%'
- from acs_object_types
- where $start_with)) t
+ (select object_type from acs_object_types ot, acs_object_types ot2
+ where ot.tree_sortkey between ot2.tree_sortkey and tree_right(ot2.tree_sortkey)
+ and $start_with)) t
where o.object_type = t.object_type) p left join
(select element_id
from group_element_map
Index: openacs-4/packages/acs-subsite/www/admin/relations/add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/add.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 11 Aug 2001 21:31:03 -0000 1.2
+++ openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 4 Dec 2001 00:20:47 -0000 1.3
@@ -185,9 +185,9 @@
# but the system creates party -1 which users
# shouldn't see.
- set start_with "object_type = 'group' or object_type = 'person'"
+ set start_with "ot.object_type = 'group' or ot.object_type = 'person'"
} else {
- set start_with "object_type = :object_type_two"
+ set start_with "ot.object_type = :object_type_two"
}
# The $allow_out_of_scope_p flag controls whether or not we limit
Index: openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql 13 May 2001 18:31:13 -0000 1.3
+++ openacs-4/packages/acs-subsite/www/admin/site-map/index-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.4
@@ -11,8 +11,7 @@
acs_permission__permission_p(s2.object_id, :user_id, 'admin') as admin_p
from site_nodes s1, site_nodes s2
where s1.node_id = :root_id
- and s2.tree_sortkey <= s1.tree_sortkey
- and s1.tree_sortkey like (s2.tree_sortkey || '%')
+ and s1.tree_sortkey between s2.tree_sortkey and tree_right(s2.tree_sortkey)
order by level
@@ -35,25 +34,25 @@
object_name, directory_p, parent_id, n_children,
(select case when acs_permission__permission_p(object_id, :user_id, 'admin') = 't' then 1 else 0 end) as object_admin_p
from apm_packages p right outer join (
- select node_id, site_node__url(node_id) as url,
- site_node__url(parent_id) as parent_url,
- name,
+ select n.node_id, site_node__url(n.node_id) as url,
+ site_node__url(n.parent_id) as parent_url,
+ n.name,
(select count(*)
from site_nodes
where parent_id = n.node_id) as n_children,
- case when node_id = site_node__node_id('/', null) then 1 else 0 end as root_p,
+ case when n.node_id = site_node__node_id('/', null) then 1 else 0 end as root_p,
(select tree_level(n.tree_sortkey) - tree_level(n2.tree_sortkey)
from site_nodes n2
where n2.node_id = coalesce(:root_id, site_node__node_id('/', null))) as mylevel,
- object_id,
- acs_object__name(object_id) as object_name,
- directory_p,
- parent_id
- from site_nodes n
- where (object_id is null or
- acs_permission__permission_p(object_id, :user_id, 'read') = 't') and
- tree_sortkey like (select tree_sortkey from site_nodes where node_id = coalesce(:root_id, site_node__node_id('/', null))) || '%' and
- (parent_id is null or parent_id in ([join $expand ", "]))) site_map
+ n.object_id,
+ acs_object__name(n.object_id) as object_name,
+ n.directory_p,
+ n.parent_id
+ from site_nodes n, site_nodes n2
+ where (n.object_id is null or acs_permission__permission_p(n.object_id, :user_id, 'read'))
+ and n2.node_id = coalesce(:root_id, site_node__node_id('/', null))
+ and n.tree_sortkey between n2.tree_sortkey and tree_right(n2.tree_sortkey)
+ and (n.parent_id is null or n.parent_id in ([join $expand ", "]))) site_map
on site_map.object_id = p.package_id
order by url
Index: openacs-4/packages/acs-subsite/www/admin/users/new-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/users/new-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-subsite/www/admin/users/new-postgresql.xql 3 Sep 2001 20:51:38 -0000 1.2
+++ openacs-4/packages/acs-subsite/www/admin/users/new-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.3
@@ -12,7 +12,7 @@
and object_type in (
select t1.object_type
from acs_object_types t1, acs_object_types t2
- where t2.tree_sortkey like (t1.tree_sortkey || '%')
+ where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = :add_with_rel_type
)
Index: openacs-4/packages/acs-tcl/tcl/navigation-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/navigation-procs-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-tcl/tcl/navigation-procs-postgresql.xql 6 Jul 2001 00:15:41 -0000 1.4
+++ openacs-4/packages/acs-tcl/tcl/navigation-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.5
@@ -9,8 +9,7 @@
tree_level(n2.tree_sortkey) as level
from (select * from site_nodes where node_id = :node_id) n1,
site_nodes n2
- where n2.tree_sortkey <= n1.tree_sortkey
- and n1.tree_sortkey like (n2.tree_sortkey || '%')
+ where n1.tree_sortkey between n2.tree_sortkey and tree_right(n2.tree_sortkey)
order by level asc
Index: openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql 7 Sep 2001 20:56:35 -0000 1.4
+++ openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.5
@@ -13,7 +13,7 @@
where object_type = :object_type) o1,
acs_object_types o2
where o2.tree_sortkey <= o1.tree_sortkey
- and o1.tree_sortkey like (o2.tree_sortkey || '%')
+ and o1.tree_sortkey between o2.tree_sortkey and tree_right(o2.tree_sortkey)
order by level desc