]> git.evergreen-ils.org Git - working/Evergreen.git/commit
Avoid escaping issues in authority.normalize_heading() by parameterizing the query
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 19 Jan 2011 14:53:48 +0000 (14:53 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 19 Jan 2011 14:53:48 +0000 (14:53 +0000)
commitcea1a7eddc2523d2a89e45d76e83f6f41ffd64dc
tree3da2adac31be3c3204df020f8a3484d02926a640
parent516d4fe2266d1fcc09ac17a8877c733e8d911607
Avoid escaping issues in authority.normalize_heading() by parameterizing the query

Long story short: MARC subfield values containing backslashes caused noise
and in some cases painful errors. Using spi_prepare/spi_exec_query is the
safest way of handling escaping, rather than adding more regexes and munging
the data before it even gets to naco_normalize().

Most painful case was <subfield code="a">Foo, Bar\</subfield> - the trailing
slash ended up escaping the enclosing single quote (because PostgreSQL isn't
configured by default with strict conformance to SQL escaping rules yet) and
threw an error.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19201 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/020.schema.functions.sql
Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
Open-ILS/src/sql/Pg/upgrade/0476.schema.authority_normalize_heading.sql [new file with mode: 0644]