]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1155313: Repair generation of label_sortkey for monograph_part entries
authorDan Pearl <dpearl@cwmars.org>
Fri, 15 Mar 2013 19:04:37 +0000 (15:04 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 2 Mar 2015 14:09:50 +0000 (14:09 +0000)
commitb5ad7edb1efe254495e39cf028202b9cc279ad79
tree6f7ae4dc15ec6b9701ff8c3add1e602c6e45a0cc
parent411ccdf421424415a6f82bcbe064ae0a884bac3c
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.1 => 00000000000000000150000000001  INCORRECT

This change will result in the correct value.

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