]> git.evergreen-ils.org Git - working/Evergreen.git/commit
Address maintain_control_numbers() database function bug #677160
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 20 Nov 2010 19:47:54 +0000 (19:47 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 20 Nov 2010 19:47:54 +0000 (19:47 +0000)
commitfb527c4e1cfae4c96d4aa2bd880343f66b329dfa
tree3108bfb946e339de341cfbc97c7b5d68e84e6d4d
parentdf3d622cb6441c167caf7713b56d3c2ef574f139
Address maintain_control_numbers() database function bug #677160

Jason Stephenson reported a bug handling records with multiple
001 or 003 fields, and supplied a set of test records to
reproduce the condition. The bug caused the ingest process
to throw a database error, rolling back the transaction and
preventing the actual ingest of those records.

The solution was to simplify the logic in maintain_control_numbers().
Now, in the case that there are either multiple 001s or 003s in the
incoming record, we simply delete all of the 003s and 001s and
create the desired 001 and 003. Also, if there are not exactly one
001 and one 003 in the incoming record, we do not try to preserve
one of those values in the 035 as it would be close to meaningless.

Many thanks to Jason for the clear bug report and test cases!

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18809 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/sql/Pg/002.functions.config.sql
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/0465.function.maintain_control_numbers.sql [new file with mode: 0644]