LP#1528901: avoid accidental bib fingerprint collisions
authorGalen Charlton <gmc@esilibrary.com>
Fri, 28 Oct 2016 17:00:45 +0000 (13:00 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 16 Feb 2017 15:02:41 +0000 (10:02 -0500)
commitcacb6861baa23d622a36b8b0240b6b96f2b291d1
treed9e92a62e738f18cecce8eb548063fdd5088f924
parent4ff655b82870af27f2b30052442d75ffce40db7c
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>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Mike Rylander <mrylander@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]