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.
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.106.2.6 2006/05/21 20:06:43 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.106.2.7 2006/10/07 00:12:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
pos = p + 1;
break;
}
+ p1 += len2 - 1;
+ p += len2 - 1;
}
p1++;
}
pos = p + 1;
break;
}
+ p1 += len2 - 1;
+ p += len2 - 1;
}
p1++;
}