Merging records does not merge located URIs
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/
Changed in evergreen: | |
importance: | Undecided → High |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
status: | Fix Released → Fix Committed |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
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"): fix-merge- record- assets- 2_1 fix-merge- record- assets- 2_0
* user/dbs/
* user/dbs/