From: Mike Rylander Date: Tue, 12 Apr 2011 17:41:19 +0000 (-0400) Subject: Corrected merge from trunk X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=55bd5e663a1a7d3e611d124fea3aee68f54daeba;p=contrib%2FConifer.git Corrected merge from trunk --- diff --git a/Open-ILS/src/sql/Pg/000.functions.general.sql b/Open-ILS/src/sql/Pg/000.functions.general.sql index 52301a457f..40ab727269 100644 --- a/Open-ILS/src/sql/Pg/000.functions.general.sql +++ b/Open-ILS/src/sql/Pg/000.functions.general.sql @@ -15,6 +15,8 @@ $$ LANGUAGE plpgsql; SELECT evergreen.change_db_setting('search_path', ARRAY['evergreen','public','pg_catalog']); +CREATE OR REPLACE FUNCTION evergreen.array_remove_item_by_value(inp ANYARRAY, el ANYELEMENT) RETURNS anyarray AS $$ SELECT ARRAY_ACCUM(x.e) FROM UNNEST( $1 ) x(e) WHERE x.e <> $2; $$ LANGUAGE SQL; + CREATE OR REPLACE FUNCTION evergreen.lowercase( TEXT ) RETURNS TEXT AS $$ return lc(shift); $$ LANGUAGE PLPERLU STRICT IMMUTABLE; diff --git a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql index a9506d15d2..7b4ba02e2e 100644 --- a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql +++ b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql @@ -2,8 +2,6 @@ DROP SCHEMA IF EXISTS vandelay CASCADE; BEGIN; -CREATE OR REPLACE FUNCTION array_remove_item_by_value(inp ANYARRAY, el ANYELEMENT) RETURNS anyarray AS $$ SELECT ARRAY_ACCUM(x.e) FROM UNNEST( $1 ) x(e) WHERE x.e <> $2; $$ LANGUAGE SQL; - CREATE SCHEMA vandelay; CREATE TABLE vandelay.match_set ( @@ -520,8 +518,8 @@ BEGIN ELSIF test.required THEN FOR tmp_rec IN SELECT * FROM UNNEST(matches) LOOP IF tmp_rec NOT IN (SELECT * FROM UNNEST(potential_matches)) THEN - matches := array_remove_item_by_value(matches, tmp_rec); - potential_matches := array_remove_item_by_value(potential_matches, tmp_rec); + matches := evergreen.array_remove_item_by_value(matches, tmp_rec); + potential_matches := evergreen.array_remove_item_by_value(potential_matches, tmp_rec); END IF; END LOOP; END IF; @@ -542,8 +540,8 @@ BEGIN ELSIF test.required THEN FOR tmp_rec IN SELECT * FROM UNNEST(matches) LOOP IF tmp_rec NOT IN (SELECT * FROM UNNEST(potential_matches)) THEN - matches := array_remove_item_by_value(matches, tmp_rec); - potential_matches := array_remove_item_by_value(potential_matches, tmp_rec); + matches := evergreen.array_remove_item_by_value(matches, tmp_rec); + potential_matches := evergreen.array_remove_item_by_value(potential_matches, tmp_rec); END IF; END LOOP; END IF;