Fix regexp_matches() handling of zero-length matches.

We'd find the same match twice if it was of zero length and not immediately
adjacent to the previous match. replace_text_regexp() got similar cases
right, so adjust this search logic to match that. Note that even though
the regexp_split_to_xxx() functions share this code, they did not display
equivalent misbehavior, because the second match would be considered
degenerate and ignored.

Jeevan Chalke, with some cosmetic changes by me.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5a27056b31fec62506ba327c7eceee0e875e201b

Modified Files
--------------
src/backend/utils/adt/regexp.c | 13 ++++----
src/backend/utils/adt/varlena.c | 5 ++-
src/test/regress/expected/strings.out | 58 +++++++++++++++++++++++++++++++++
src/test/regress/sql/strings.sql | 7 ++++
4 files changed, 75 insertions(+), 8 deletions(-)

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 6 | next ›
Discussion Overview
grouppgsql-committers @
categoriespostgresql
postedJul 31, '13 at 3:32p
activeJul 31, '13 at 3:32p
posts6
users1
websitepostgresql.org...
irc#postgresql

1 user in discussion

Tom Lane: 6 posts

People

Translate

site design / logo © 2018 Grokbase