fix cut-n-paste-o
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 13 Aug 2010 04:07:48 +0000 (04:07 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 13 Aug 2010 04:07:48 +0000 (04:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17206 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/upgrade/0370.schema.protect-authority-linking.sql

index c787062..c9e8316 100644 (file)
@@ -900,9 +900,9 @@ CREATE OR REPLACE FUNCTION biblio.map_authority_linking (bibid BIGINT, marc TEXT
         SELECT  y.bib,
                 y.authority
           FROM (    SELECT  DISTINCT $1 AS bib,
-                            BTRIM(remove_paren_substring(x))::BIGINT AS authority
+                            BTRIM(remove_paren_substring(txt))::BIGINT AS authority
                       FROM  explode_array(oils_xpath('//*[@code="0"]/text()',$2)) x(txt)
-                      WHERE BTRIM(remove_paren_substring(x)) ~ $re$^\d+$$re$
+                      WHERE BTRIM(remove_paren_substring(txt)) ~ $re$^\d+$$re$
                 ) y JOIN authority.record_entry r ON r.id = y.authority;
     SELECT $1;
 $func$ LANGUAGE SQL;
index 7109fbd..ee57681 100644 (file)
@@ -8,9 +8,9 @@ CREATE OR REPLACE FUNCTION biblio.map_authority_linking (bibid BIGINT, marc TEXT
         SELECT  y.bib,
                 y.authority
           FROM (    SELECT  DISTINCT $1 AS bib,
-                            BTRIM(remove_paren_substring(x))::BIGINT AS authority
+                            BTRIM(remove_paren_substring(txt))::BIGINT AS authority
                       FROM  explode_array(oils_xpath('//*[@code="0"]/text()',$2)) x(txt)
-                      WHERE BTRIM(remove_paren_substring(x)) ~ $re$^\d+$$re$
+                      WHERE BTRIM(remove_paren_substring(txt)) ~ $re$^\d+$$re$
                 ) y JOIN authority.record_entry r ON r.id = y.authority;
     SELECT $1;
 $func$ LANGUAGE SQL;