forked from evergreen-library-system/Evergreen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'tags/rel_2_12_9' into iish_master_rel_2_12_9
# Conflicts: # ChangeLog # Open-ILS/src/perlmods/lib/OpenILS.pm # Open-ILS/src/perlmods/lib/OpenILS/Application.pm # Open-ILS/src/sql/Pg/002.schema.config.sql # Open-ILS/xul/staff_client/chrome/content/main/about.html # Open-ILS/xul/staff_client/defaults/preferences/prefs.js # README # build/i18n/po/AutoFieldWidget.js/AutoFieldWidget.js.pot # build/i18n/po/FlattenerGrid.js/FlattenerGrid.js.pot # build/i18n/po/PCrudFilterPane.js/PCrudFilterPane.js.pot # build/i18n/po/Searcher.js/Searcher.js.pot # build/i18n/po/TranslatorPopup.js/TranslatorPopup.js.pot # build/i18n/po/URLVerify.js/URLVerify.js.pot # build/i18n/po/User.js/User.js.pot # build/i18n/po/XULTermLoader.js/XULTermLoader.js.pot # build/i18n/po/acq.js/acq.js.pot # build/i18n/po/admin.properties/admin.properties.pot # build/i18n/po/auth.properties/auth.properties.pot # build/i18n/po/authority.js/authority.js.pot # build/i18n/po/capture.js/capture.js.pot # build/i18n/po/cat.properties/cat.properties.pot # build/i18n/po/circ.properties/circ.properties.pot # build/i18n/po/common.properties/common.properties.pot # build/i18n/po/conify.dtd/conify.dtd.pot # build/i18n/po/conify.js/conify.js.pot # build/i18n/po/db.seed/db.seed.pot # build/i18n/po/fm_IDL.dtd/fm_IDL.dtd.pot # build/i18n/po/ils_events.xml/ils_events.xml.pot # build/i18n/po/lang.dtd/lang.dtd.pot # build/i18n/po/match_set.js/match_set.js.pot # build/i18n/po/offline.properties/offline.properties.pot # build/i18n/po/opac.dtd/opac.dtd.pot # build/i18n/po/opac.js/opac.js.pot # build/i18n/po/patron.properties/patron.properties.pot # build/i18n/po/pickup_and_return.js/pickup_and_return.js.pot # build/i18n/po/pull_list.js/pull_list.js.pot # build/i18n/po/register.js/register.js.pot # build/i18n/po/reports.dtd/reports.dtd.pot # build/i18n/po/reports.js/reports.js.pot # build/i18n/po/reservation.js/reservation.js.pot # build/i18n/po/selfcheck.js/selfcheck.js.pot # build/i18n/po/serial.js/serial.js.pot # build/i18n/po/serial.properties/serial.properties.pot # build/i18n/po/vandelay.js/vandelay.js.pot # build/i18n/po/webstaff/webstaff.pot # configure.ac # docs/installation/server_upgrade.adoc
- Loading branch information
Showing
92 changed files
with
7,950 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
Open-ILS/src/sql/Pg/t/lp1145213_test_func_asset.merge_record_assets.pg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
BEGIN; | ||
|
||
SELECT plan(5); | ||
|
||
---------------------------------- | ||
-- | ||
-- Setup Test environment and data | ||
-- | ||
---------------------------------- | ||
|
||
-- create mock bib records to be merged: | ||
-- Data: | ||
-- bib 60000 (new lead), org 4 acn 'F Cline' copy 1 | ||
-- bib 60001 (merged from target), org 5 acn 'JF cline' copy 2, org 6 acn 'JF Cline' copy 3, org 4 acn 'F Cline' copy 4 | ||
-- | ||
-- copy 2 ACN | ||
|
||
-- create bib 60,000 | ||
INSERT into biblio.record_entry (id, marc, last_xact_id) | ||
VALUES (60000, | ||
$$ | ||
<record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"><leader>00934njm a2200241 a 4500</leader><controlfield tag="001">03-0003745</controlfield><controlfield tag="005">19991118131708.0</controlfield><controlfield tag="008">971016n nyuuuu eng </controlfield><datafield tag="050" ind1=" " ind2=" "><subfield code="a">4539</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Bartók, Béla,</subfield><subfield code="d">1881-1945.</subfield></datafield><datafield tag="240" ind1=" " ind2=" "><subfield code="t">Concertos,</subfield><subfield code="m">piano,</subfield><subfield code="n">no. 1,</subfield><subfield code="n">Sz. 83</subfield><subfield code="f">(1926) </subfield><subfield code="a">Concertos,</subfield><subfield code="m">piano,</subfield><subfield code="n">no. 1,</subfield><subfield code="n">Sz. 83,</subfield><subfield code="n">(1926)</subfield></datafield><datafield tag="245" ind1=" " ind2=" "><subfield code="a">Piano concerto no. 1 (1926) ; Rhapsody, op. 1 (1904)</subfield></datafield><datafield tag="260" ind1=" " ind2=" "><subfield code="a">New York, NY :</subfield><subfield code="b">Vox</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">1 sound disc :</subfield><subfield code="b">33 1/3 rpm, stereo.</subfield></datafield><datafield tag="349" ind1=" " ind2=" "><subfield code="a">PHONO RECORD</subfield></datafield><datafield tag="511" ind1=" " ind2=" "><subfield code="a">György Sándor, piano ; Sudwest[rund]funkorchester, Baden-Baden ; Rolf Reinhardt, conductor.</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Sándor, György,</subfield><subfield code="d">1912-</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Reinhardt, Rolf</subfield></datafield><datafield tag="710" ind1=" " ind2=" "><subfield code="a">Sudwestrundfunkorchester (Baden-Baden, Germany)</subfield></datafield><datafield tag="730" ind1=" " ind2=" "><subfield code="a">Rhapsodies,</subfield><subfield code="m">piano, orchestra,</subfield><subfield code="n">op. 1,</subfield><subfield code="n">Sz. 27,</subfield><subfield code="n">(1904)</subfield></datafield><datafield tag="901" ind1=" " ind2=" "><subfield code="a">a339398</subfield><subfield code="b">Sirsi_Auto</subfield><subfield code="c">339398</subfield></datafield></record> | ||
$$, | ||
'PGTAP' | ||
); | ||
|
||
|
||
-- create bib 60,001 | ||
INSERT into biblio.record_entry (id, marc, last_xact_id) | ||
VALUES (60001, | ||
$$ | ||
<record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"><leader>00863njm a2200253 a 4500</leader><controlfield tag="001">03-0004689</controlfield><controlfield tag="005">19991127191346.0</controlfield><controlfield tag="008">971027r19631952nyuuuu eng </controlfield><datafield tag="050" ind1=" " ind2=" "><subfield code="a">4578</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Telemann, Georg Philipp,</subfield><subfield code="d">1681-1767</subfield></datafield><datafield tag="245" ind1=" " ind2=" "><subfield code="a">Viola concerto in G major</subfield></datafield><datafield tag="260" ind1=" " ind2=" "><subfield code="a">New York, NY :</subfield><subfield code="b">Vox,</subfield><subfield code="c">1963</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">1 sound disc :</subfield><subfield code="b">33 1/3 rpm, mono.</subfield></datafield><datafield tag="349" ind1=" " ind2=" "><subfield code="a">PHONO RECORD</subfield></datafield><datafield tag="505" ind1=" " ind2=" "><subfield code="a">Viola concerto / Telemann -- Viola concerto in D major / Stamitz.</subfield></datafield><datafield tag="511" ind1=" " ind2=" "><subfield code="a">Heinz Wigand, viola ; Pro Musica Orchestra, Stuttgart ; Rolf Reinhardt, conductor.</subfield></datafield><datafield tag="650" ind1=" " ind2="0"><subfield code="a">Concertos (Viola)</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Stamitz, Carl,</subfield><subfield code="d">1745-1801</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Reinhardt, Rolf</subfield></datafield><datafield tag="700" ind1=" " ind2=" "><subfield code="a">Wigand, Heinz</subfield></datafield><datafield tag="710" ind1="2" ind2=" "><subfield code="a">Pro Musica Orchestra (Stuttgart)</subfield></datafield><datafield tag="901" ind1=" " ind2=" "><subfield code="a">a340312</subfield><subfield code="b">Sirsi_Auto</subfield><subfield code="c">340312</subfield></datafield></record> | ||
$$, | ||
'PGTAP' | ||
); | ||
|
||
|
||
INSERT into asset.call_number(id, record, creator, editor, owning_lib, label, label_class, prefix) | ||
VALUES (999999, 60000, 1, 1, 4, 'Cline', 1, 9986), | ||
(1000000,60001, 1, 1, 5, 'Cline', 1, 9987), | ||
(1000001,60001, 1, 1, 6, 'Cline', 1, 9988), | ||
(1000002,60001, 1, 1, 4, 'Cline', 1, 9986); | ||
|
||
INSERT into asset.call_number_prefix(id, owning_lib, label) VALUES | ||
(9986, 4, 'F'), | ||
(9987, 5, 'F'), | ||
(9988, 6, 'JF'); | ||
|
||
-- circ_lib for copy == the same as acn | ||
INSERT INTO asset.copy(id, circ_lib, creator, call_number, editor, copy_number, loan_duration, fine_level, barcode) VALUES | ||
(905555, 4, 1, 999999, 1, 1, 1, 1, '1copycopycopy'), | ||
(906666, 5, 1, 1000000, 1, 1, 1, 1, '2copycopycopy'), | ||
(907777, 6, 1, 1000001, 1, 1, 1, 1, '3copycopycopy'), | ||
(908888, 4, 1, 1000002, 1, 1, 1, 1, '4copycopycopy'); | ||
|
||
----------------------------------- | ||
-- Test asset.merge_record_assets() | ||
----------------------------------- | ||
|
||
-- do merge | ||
SELECT is(asset.merge_record_assets(60000, 60001), 4, 'Record assets merged!'); | ||
|
||
-- check if copy 4's acn was updated | ||
SELECT is( | ||
(SELECT call_number from asset.copy where id=908888)::BIGINT, | ||
999999::BIGINT, | ||
'LP 1145213 asset.merge_record_assets() messing up call numbers. copy 4 should have acn -> 999999' | ||
); | ||
|
||
-- acn #1,000,002 should be deleted | ||
SELECT is( | ||
(SELECT deleted FROM asset.call_number WHERE id=1000002)::BOOLEAN, | ||
TRUE, | ||
'LP 1145213 asset.merge_record_assets() should have deleted acn #1000002' | ||
); | ||
|
||
-- all non-deleted acn should point to source bib record #60,000 | ||
SELECT is( | ||
(SELECT count(*) FROM asset.call_number WHERE record=60001 AND not deleted=true)::INT, | ||
0::INT, | ||
'LP 1145213 asset.merge_record_assets() all call_numbers should point to bib record #60,000 ' | ||
); | ||
|
||
-- test copies to make sure none point to stale acn | ||
SELECT is( | ||
(SELECT count(*) from asset.copy where call_number=1000002)::INT, | ||
0::INT, | ||
'LP 1145213 asset.merge_record_assets() all copies should point to acn #999999 which is for bib record #60,000 ' | ||
); | ||
|
||
SELECT * FROM finish(); | ||
|
||
ROLLBACK; | ||
|
Oops, something went wrong.