LP#1482757: Remove 'orphaned_uri_list' and 'NOT cn.deleted' criteria
authorMichele Morgan <mmorgan@noblenet.org>
Fri, 24 Apr 2020 16:43:39 +0000 (12:43 -0400)
committerMichele Morgan <mmorgan@noblenet.org>
Fri, 25 Feb 2022 19:56:36 +0000 (14:56 -0500)
Per Dan Wells' suggestions.

1) One possible "crack" I see for data to fall through is the dead map
selector. The "AND cn.label = '##URI##' AND NOT cn.deleted" seems overly
restrictive. Now, I realize we *shouldn't* have mappings to deleted or
non-##URI## call numbers, but it isn't impossible, and I don't think we'd
have harm in leaving those restrictions out. If a map isn't used, let's
get rid of it regardless, I think.

2) (side note) orphaned_uri_list doesn't seems to be used any more, so
should be removed.

Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>

Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql

index 8489999..232bf88 100644 (file)
@@ -1415,7 +1415,7 @@ DECLARE
     uri_map_count   INT;
     current_uri_map_list    INT[];
     current_map_owner_list  INT[];
-    orphaned_uri_list       INT[];
+
 BEGIN
 
     uris := oils_xpath('//*[@tag="856" and (@ind1="4" or @ind1="1") and (@ind2="0" or @ind2="1")]',marcxml);
@@ -1514,7 +1514,6 @@ BEGIN
                 JOIN asset.call_number cn ON (cn.id = m.call_number)
           WHERE cn.record = bib_id
                 AND cn.label = '##URI##'
-                AND NOT cn.deleted
                 AND NOT (m.id = ANY (current_uri_map_list))
     LOOP
         SELECT uri INTO current_uri FROM asset.uri_call_number_map WHERE id = current_map;
index 6e5823c..d4c86c7 100644 (file)
@@ -18,7 +18,7 @@ DECLARE
     uri_map_count   INT;
     current_uri_map_list    INT[];
     current_map_owner_list  INT[];
-    orphaned_uri_list       INT[];
+
 BEGIN
 
     uris := oils_xpath('//*[@tag="856" and (@ind1="4" or @ind1="1") and (@ind2="0" or @ind2="1")]',marcxml);
@@ -117,7 +117,6 @@ BEGIN
                 JOIN asset.call_number cn ON (cn.id = m.call_number)
           WHERE cn.record = bib_id
                 AND cn.label = '##URI##'
-                AND NOT cn.deleted
                 AND NOT (m.id = ANY (current_uri_map_list))
     LOOP
         SELECT uri INTO current_uri FROM asset.uri_call_number_map WHERE id = current_map;