LP #1155313: Repair generation of label_sortkey for monograph_part entries user/dpearl/sortkey
authorDan Pearl <dpearl@cwmars.org>
Fri, 15 Mar 2013 19:04:37 +0000 (15:04 -0400)
committerDan Pearl <dpearl@cwmars.org>
Fri, 15 Mar 2013 19:04:37 +0000 (15:04 -0400)
commit4e29bcfe2983b23e00b0c319dd281f50deb71b3e
tree56e32b2daf5b30b7167d544c83ff608e4c10f73c
parent58d4b4aaf372a51d4cccc9d9d5b37aa0281a9aab
LP #1155313: Repair generation of label_sortkey for monograph_part entries

The evergreen.lpad_number_substrings function attempts to codify numeric
fields within labels.  It does this by finding the strings, padding them
to a given size, and replacing them in the source string.  For instance:
       3 => 0000000003
    15.4 => 00000000150000000004

The algorithm was fooled by repeated characters, like in 15.1:
    15.4 => 00000000000000000150000000001  INCORRECT

This change will result in the correct value.

Signed-off-by: Dan Pearl <dpearl@cwmars.org>
Open-ILS/src/sql/Pg/002.functions.config.sql