[open-ils-commits] [GIT] Evergreen ILS branch rel_3_4 updated. 1f2e3549a2d744aa57ad248566eb5e1bb14070a7

Evergreen Git git at git.evergreen-ils.org
Fri Jul 17 07:15:14 EDT 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_4 has been updated
       via  1f2e3549a2d744aa57ad248566eb5e1bb14070a7 (commit)
       via  a78747a609f3db4b557bb2305cb85d9c0adc9b79 (commit)
      from  f043d0180c10d7fffc8c65e87d2527c582f7b5ea (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1f2e3549a2d744aa57ad248566eb5e1bb14070a7
Author: Jason Stephenson <jason at sigio.com>
Date:   Fri Jul 17 07:09:29 2020 -0400

    LP#1886852: Stamping Upgrade Script
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index ba79e0e176..8187c3b8ee 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1204', :eg_version); -- jeffdavis/sandbergja/csharp
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1206', :eg_version); -- miker/dyrcona
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql b/Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql
similarity index 82%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
rename to Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql
index 2d4739a48e..a1ecf1b55c 100755
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql
@@ -1,6 +1,6 @@
 BEGIN;
 
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1206', :eg_version);
 
 CREATE OR REPLACE FUNCTION
     action.hold_request_regen_copy_maps(

commit a78747a609f3db4b557bb2305cb85d9c0adc9b79
Author: Mike Rylander <mrylander at gmail.com>
Date:   Wed Jul 8 13:18:52 2020 -0400

    LP#1886852: Protect against dupes in hold-copy map function
    
    If the DB function that regenerates the hold-copy maps for a hold
    receives duplicate copies in its second parameter, it blows up.  This
    commit prevents that by making the list unique at use time.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql
index af8a3e36b9..8d8163b6f9 100644
--- a/Open-ILS/src/sql/Pg/090.schema.action.sql
+++ b/Open-ILS/src/sql/Pg/090.schema.action.sql
@@ -548,7 +548,7 @@ CREATE OR REPLACE FUNCTION
     action.hold_request_regen_copy_maps(
         hold_id INTEGER, copy_ids INTEGER[]) RETURNS VOID AS $$
     DELETE FROM action.hold_copy_map WHERE hold = $1;
-    INSERT INTO action.hold_copy_map (hold, target_copy) SELECT $1, UNNEST($2);
+    INSERT INTO action.hold_copy_map (hold, target_copy) SELECT DISTINCT $1, UNNEST($2);
 $$ LANGUAGE SQL;
 
 CREATE TABLE action.transit_copy (
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
new file mode 100755
index 0000000000..2d4739a48e
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
@@ -0,0 +1,12 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION
+    action.hold_request_regen_copy_maps(
+        hold_id INTEGER, copy_ids INTEGER[]) RETURNS VOID AS $$
+    DELETE FROM action.hold_copy_map WHERE hold = $1;
+    INSERT INTO action.hold_copy_map (hold, target_copy) SELECT DISTINCT $1, UNNEST($2);
+$$ LANGUAGE SQL;
+
+COMMIT;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql                    |  2 +-
 Open-ILS/src/sql/Pg/090.schema.action.sql                    |  2 +-
 .../sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql | 12 ++++++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100755 Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list