pgsql: Fix regexp substring matching (substring(string from pattern)) - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix regexp substring matching (substring(string from pattern))
Date
Msg-id 20080319024053.2B7B97558DC@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix regexp substring matching (substring(string from pattern)) for the corner
case where there is a match to the pattern overall but the user has specified
a parenthesized subexpression and that subexpression hasn't got a match.
An example is substring('foo' from 'foo(bar)?').  This should return NULL,
since (bar) isn't matched, but it was mistakenly returning the whole-pattern
match instead (ie, 'foo').  Per bug #4044 from Rui Martins.

This has been broken since the beginning; patch in all supported versions.
The old behavior was sufficiently inconsistent that it's impossible to believe
anyone is depending on it.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        regexp.c (r1.66.2.1 -> r1.66.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/regexp.c?r1=1.66.2.1&r2=1.66.2.2)

pgsql-committers by date:

Previous
From: ishii@postgresql.org (Tatsuo Ishii)
Date:
Subject: pgsql: Add -M (query mode) option per ITAGAKI Takahiro
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix regexp substring matching (substring(string from pattern))