From c22457a92e3e9b44d0aaa5d9e94e00f58b08a7d7 Mon Sep 17 00:00:00 2001 From: Michele Morgan Date: Fri, 24 Apr 2020 12:43:39 -0400 Subject: [PATCH] LP#1482757: Remove 'orphaned_uri_list' and 'NOT cn.deleted' criteria 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 Signed-off-by: Jason Stephenson Signed-off-by: Michele Morgan --- Open-ILS/src/sql/Pg/030.schema.metabib.sql | 3 +-- .../src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql index 8489999245..232bf8857b 100644 --- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql +++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql @@ -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; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql index 6e5823c2d2..d4c86c77ba 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql @@ -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; -- 2.11.0