Resolve inconsistent results when invoking LOWER() in C vs. UTF8 locale databases
[evergreen-equinox.git] / Open-ILS / src / sql / Pg / 012.schema.vandelay.sql
index 0add48d..476ee07 100644 (file)
@@ -1126,7 +1126,7 @@ BEGIN
     
                -- Looks like an ISBN? check for an isbn match
                IF (attr.attr_value ~* $r$^[0-9x]+$$r$ AND character_length(attr.attr_value) IN (10,13)) THEN
-               FOR eg_rec IN EXECUTE $$SELECT * FROM metabib.full_rec fr WHERE fr.value LIKE LOWER('$$ || attr.attr_value || $$%') AND fr.tag = '020' AND fr.subfield = 'a'$$ LOOP
+               FOR eg_rec IN EXECUTE $$SELECT * FROM metabib.full_rec fr WHERE fr.value LIKE evergreen.lowercase('$$ || attr.attr_value || $$%') AND fr.tag = '020' AND fr.subfield = 'a'$$ LOOP
                                PERFORM id FROM biblio.record_entry WHERE id = eg_rec.record AND deleted IS FALSE;
                                IF FOUND THEN
                                INSERT INTO vandelay.bib_match (field_type, matched_attr, queued_record, eg_record) VALUES ('isbn', attr.id, NEW.id, eg_rec.record);