Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql	11 Dec 2003 21:39:47 -0000	1.2
+++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql	26 Jan 2004 15:39:43 -0000	1.3
@@ -448,20 +448,23 @@
   is_assigned__keyword_id             alias for $2;  
   is_assigned__recurse                alias for $3;  -- default ''none''  
   v_ret                               boolean;    
+  v_is_assigned__recurse	      varchar;
 begin
   if is_assigned__recurse is null then 
-	is_assigned__recurse := ''none'';
+	v_is_assigned__recurse := ''none'';
+  else
+      	v_is_assigned__recurse := is_assigned__recurse;	
   end if;
 
   -- Look for an exact match
-  if is_assigned__recurse = ''none'' then
+  if v_is_assigned__recurse = ''none'' then
       return count(*) > 0 from cr_item_keyword_map
        where item_id = is_assigned__item_id
          and keyword_id = is_assigned__keyword_id;
   end if;
 
   -- Look from specific to general
-  if is_assigned__recurse = ''up'' then
+  if v_is_assigned__recurse = ''up'' then
       return count(*) > 0
       where exists (select 1
                     from (select keyword_id from cr_keywords c, cr_keywords c2
@@ -472,7 +475,7 @@
                       and m.item_id = is_assigned__item_id);
   end if;
 
-  if is_assigned__recurse = ''down'' then
+  if v_is_assigned__recurse = ''down'' then
       return count(*) > 0
       where exists (select 1
                     from (select k2.keyword_id
