Skip site navigation (1) Skip section navigation (2)

pgsql: Fix string_to_array() to correctly handle the case where there

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix string_to_array() to correctly handle the case where there
Date: 2006-10-07 00:11:54
Message-ID: 20061007001154.700D69FB43E@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix string_to_array() to correctly handle the case where there are
overlapping possible matches for the separator string, such as
string_to_array('123xx456xxx789', 'xx').
Also, revise the logic of replace(), split_part(), and string_to_array()
to avoid O(N^2) work from redundant searches and conversions to pg_wchar
format when there are N matches to the separator string.
Backpatched the full patch as far as 8.0.  7.4 also has the bug, but the
code has diverged a lot, so I just went for a quick-and-dirty fix of the
bug itself in that branch.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        varlena.c (r1.151 -> r1.152)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/varlena.c.diff?r1=1.151&r2=1.152)

pgsql-committers by date

Next:From: Tom LaneDate: 2006-10-07 00:11:59
Subject: pgsql: Fix string_to_array() to correctly handle the case where there
Previous:From: Tom LaneDate: 2006-10-06 18:53:54
Subject: pgsql: Fix bcc32.mak to create and remove pg_config_os.h properly.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group