LP#1528901: avoid accidental bib fingerprint collisions user/rogan/lp15288901_more_precise_fingerprinting_signoff
authorGalen Charlton <gmc@esilibrary.com>
Fri, 28 Oct 2016 17:00:45 +0000 (13:00 -0400)
committerRogan Hamby <rogan.hamby@gmail.com>
Fri, 4 Nov 2016 15:12:18 +0000 (11:12 -0400)
commitaf6ae908f8782ab6cba5e14aad8125e51464c90e
tree08c531313fdba770c4f772a26519d3b91d22521d
parentad0f60ac409b8434a5ee3e552b2efa0358ae6a00
LP#1528901: avoid accidental bib fingerprint collisions

This patch fixes a problem where the bib fingerprint algorithm
could end up putting completely different works in the same
metarecord. For example,

100 $a Steel, Danielle
245 $a Blue

and

*no 1XX
245 $a Blue steel

previously (with stock config.biblio_fingerprint settings) got
a fingerprint of "bluesteel". With this patch, their fingerprints
are now:

"Title:blue Author:steel"

and

"Title:bluesteel Author:"

The upgrade script supplied with this patch remaps the metarecords
after updating the fingerprints. While existing metarecord holds
may get moved, note that there is no known way of ensuring that a
metarecord hold placed on a collided metarecord will end up attach
to whatever work the patron intended to request.

To test:

[1] Add records for "Blue" and "Blue steel".
[2] Note that they end up on the same metarecord.
[3] Apply the patch and perform the update.
[4] The two bibs should now be on separate metarecords.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/t/lp1528901_more_precise_fingerprints.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.update_fingerprinting.sql [new file with mode: 0644]