pgsql: Make replace(), split_part(), and string_to_array() behave - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Make replace(), split_part(), and string_to_array() behave
Date
Msg-id 20070719203454.CD7AE9FBA00@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Make replace(), split_part(), and string_to_array() behave somewhat sanely
when handed an invalidly-encoded pattern.  The previous coding could get
into an infinite loop if pg_mb2wchar_with_len() returned a zero-length
string after we'd tested for nonempty pattern; which is exactly what it
will do if the string consists only of an incomplete multibyte character.
This led to either an out-of-memory error or a backend crash depending
on platform.  Per report from Wiktor Wodecki.

Tags:
----
REL7_3_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        varlena.c (r1.92.2.5 -> r1.92.2.6)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/varlena.c.diff?r1=1.92.2.5&r2=1.92.2.6)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Make replace(), split_part(), and string_to_array() behave
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: On second thought, the tests for what to do with stderr output