Merging records does not merge located URIs

Bug #873449 reported by Dan Scott
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
2.0
Fix Released
High
Unassigned
2.1
Fix Released
High
Unassigned

Bug Description

* Evergreen master (almost undoubtedly affects previous versions as well though)
* PostgreSQL 9.0.5
* Fedora 15

The setup:

Add two records to the system. Ensure one has a located URI (856 40 $u $y $9). Add both records to a record bucket. Merge the records, choosing the record that does not have the located URI as the lead record.

Expected results:

The lead record should now have the located URI.

Actual results:

The located URI does not get added to the lead record.

Analysis:

The problem is that the XPath used to generate the counter for looping through the possible located URIs returned a number higher than the number of 856 datafields; rather, it returns a number like '7' for a single 856 (representing subfield nodes, whitespace text nodes, etc). For all of the non-datafield nodes, a NULL result is returned; this is then concatenated onto the string, turning the string NULL as well.

Fix:

Adding a COALSCE() to prevent the NULL values from turning the string NULL works around the problem. There may also be a more efficient XPath expression to get an accurate count of 856 datafields, avoiding pointless loops, but working code wins & is appreciated in the field.

Remedy:

I have pushed the branch user/dbs/fix-merge-record-assets into the working repo to address master. This probably needs to be backported all the way through 2.0, however.

Dan Scott (denials)
Changed in evergreen:
importance: Undecided → High
Revision history for this message
Dan Scott (denials) wrote :

Added rel_2_1 and rel_2_0 variants to the working repo (and force-pushed a minor update to the master branch, to fix references to "action"):
  * user/dbs/fix-merge-record-assets-2_1
  * user/dbs/fix-merge-record-assets-2_0

Changed in evergreen:
milestone: none → 2.2.0
Revision history for this message
Mike Rylander (mrylander) wrote :

Pushed all three branches. Thanks, Dan!

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
status: Fix Released → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.