Bug 14472: Wrong ISSN search index in record matching rules
authorAmit Gupta <amit.gupta@informaticsglobal.com>
Mon, 29 Jun 2015 16:12:08 +0000 (21:42 +0530)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 7 Sep 2015 14:36:19 +0000 (11:36 -0300)
To Test
---------
 1) Apply the patch
 2) Export some MARC bibliographic records from Koha
 3) Import those same MARC bibliographic records using the
    "ISSN(022$a)" record matching rule.
 4) The incoming records should match perfectly
 5) Check the mysql tables (marc_matchers, matchpoints,
    matcher_matchpoints, matchpoint_components,
    matchpoint_component_norms) to make sure the values were
    inserted as expected.
For new Koha installation
 1) create the koha database
 2) Go to the staff client page, and do a "fresh" install making
    sure to select lots of optional marc 21 matching rules so
    the .../marc21/optional/marc21_default_matching_rules.sql
    gets triggered.
 3) Check the mysql tables (marc_matchers, matchpoints,
    matcher_matchpoints, matchpoint_components,
    matchpoint_component_norms) to make sure the values were
    inserted as expected.

Bug 14472 - Added Atomic Update to fix wrong issn search index

    - Fix comments

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/atomicupdate/bug_14472_Wrong_ISSN_search_index_in_record_matching_rules.sql [new file with mode: 0644]
installer/data/mysql/de-DE/marcflavour/marc21/optional/marc21_default_matching_rules.sql
installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql
installer/data/mysql/es-ES/marcflavour/marc21/optional/marc21_default_matching_rules.sql
installer/data/mysql/fr-FR/marcflavour/marc21/Optionnel/marc21_default_matching_rules.sql
installer/data/mysql/it-IT/marcflavour/marc21/optional/marc21_default_matching_rules.sql
installer/data/mysql/nb-NO/marcflavour/marc21/optional/marc21_default_matching_rules.sql
installer/data/mysql/pl-PL/marcflavour/marc21/optional/marc21_default_matching_rules.sql
installer/data/mysql/ru-RU/marcflavour/marc21/optional/marc21_default_matching_rules.sql
installer/data/mysql/uk-UA/marcflavour/marc21/optional/marc21_default_matching_rules.sql

diff --git a/installer/data/mysql/atomicupdate/bug_14472_Wrong_ISSN_search_index_in_record_matching_rules.sql b/installer/data/mysql/atomicupdate/bug_14472_Wrong_ISSN_search_index_in_record_matching_rules.sql
new file mode 100644 (file)
index 0000000..a9af1f3
--- /dev/null
@@ -0,0 +1 @@
+UPDATE matchpoints SET search_index ='issn' where matcher_id = (SELECT matcher_id FROM marc_matchers WHERE code = 'ISSN');
index 4d39a5e..b863911 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold) 
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) 
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 801f04a..2e538a4 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold) 
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) 
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 4d39a5e..b863911 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold) 
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) 
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 4d39a5e..b863911 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold) 
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) 
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 4d39a5e..b863911 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold) 
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) 
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 4d39a5e..b863911 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold) 
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) 
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 266a300..083efdf 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold)
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 4f41421..5415075 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold)
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;
index 4f41421..5415075 100644 (file)
@@ -29,7 +29,7 @@ INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_
 
 INSERT INTO marc_matchers (code, description, record_type, threshold)
     VALUES ('ISSN', '022$a', 'biblio', 1000);
-INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'isbn', 1000 FROM marc_matchers;
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'issn', 1000 FROM marc_matchers;
 INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
     SELECT MAX(matchpoint_id), 1, '022', 'a' FROM matchpoints;