From a07592f62e212781445726d07b9e0918e451430e Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 15 Apr 2011 15:38:13 +0000 Subject: [PATCH] thinko in for-in-array loop, uncovered by error testing from Ben Shum git-svn-id: svn://svn.open-ils.org/ILS/trunk@20101 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/030.schema.metabib.sql | 4 +++- Open-ILS/src/sql/Pg/upgrade/0517.schema.multiple-9s-in-856.sql | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql index c4099a0e5b..99567b08ce 100644 --- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql +++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql @@ -853,7 +853,9 @@ BEGIN SELECT id INTO uri_id FROM asset.uri WHERE label = uri_label AND href = uri_href AND use_restriction = uri_use AND active; END IF; - FOR uri_owner IN 1 .. ARRAY_UPPER(uri_owner_list, 1) LOOP + FOR j IN 1 .. ARRAY_UPPER(uri_owner_list, 1) LOOP + uri_owner := uri_owner_list[j]; + SELECT id INTO uri_owner_id FROM actor.org_unit WHERE shortname = uri_owner; CONTINUE WHEN NOT FOUND; diff --git a/Open-ILS/src/sql/Pg/upgrade/0517.schema.multiple-9s-in-856.sql b/Open-ILS/src/sql/Pg/upgrade/0517.schema.multiple-9s-in-856.sql index e044794bb2..85dcdb5fdd 100644 --- a/Open-ILS/src/sql/Pg/upgrade/0517.schema.multiple-9s-in-856.sql +++ b/Open-ILS/src/sql/Pg/upgrade/0517.schema.multiple-9s-in-856.sql @@ -52,7 +52,9 @@ BEGIN SELECT id INTO uri_id FROM asset.uri WHERE label = uri_label AND href = uri_href AND use_restriction = uri_use AND active; END IF; - FOR uri_owner IN 1 .. ARRAY_UPPER(uri_owner_list, 1) LOOP + FOR j IN 1 .. ARRAY_UPPER(uri_owner_list, 1) LOOP + uri_owner := uri_owner_list[j]; + SELECT id INTO uri_owner_id FROM actor.org_unit WHERE shortname = uri_owner; CONTINUE WHEN NOT FOUND; -- 2.11.0