Index: openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql,v diff -u -r1.14 -r1.15 --- openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql 3 Dec 2001 19:02:53 -0000 1.14 +++ openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql 8 Dec 2001 01:18:00 -0000 1.15 @@ -101,14 +101,12 @@ update static_pages set show_comments_p = :show_full_comments_p where static_page_id in ( - select static_page_id from static_pages - where folder_id in ( - select folder_id from sp_folders where - tree_sortkey like ( select tree_sortkey || '%' - from sp_folders - where folder_id = :root_folder_id) - ) - and filename like '%${contained_string}%' + select sp.static_page_id + from static_pages sp, sp_folders s1, sp_folders s2 + where sp.folder_id = s1.folder_id + and s2.folder_id = :root_folder_id + and s1.tree_sortkey between s2.tree_sortkey and tree_right(s2.tree_sortkey) + and sp.filename like '%${contained_string}%' ) @@ -121,14 +119,12 @@ begin for file_row in - select static_page_id from static_pages - where folder_id in ( - select folder_id from sp_folders where - tree_sortkey like ( select tree_sortkey || '%' - from sp_folders - where folder_id = :root_folder_id) - ) and - filename like '%${contained_string}%' + select sp.static_page_id + from static_pages sp, sp_folders s1, sp_folders s2 + where sp.folder_id = s1.folder_id + and s2.folder_id = :root_folder_id + and s1.tree_sortkey between s2.tree_sortkey and tree_right(s2.tree_sortkey) + and sp.filename like '%${contained_string}%' loop PERFORM acs_permission__${grant_or_revoke}_permission( @@ -146,13 +142,12 @@ - select static_page_id from static_pages - where folder_id in ( - select folder_id from sp_folders - where tree_sortkey like - (select tree_sortkey ||'%' from sp_folders - where folder_id = :root_folder_id) - ) and filename like '%${contained_string}%' + select sp.static_page_id + from static_pages sp, sp_folders s1, sp_folders s2 + where sp.folder_id = s1.folder_id + and s2.folder_id = :root_folder_id + and s1.tree_sortkey between s2.tree_sortkey and tree_right(s2.tree_sortkey) + and sp.filename like '%${contained_string}%'