pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix enforcement of restrictions inside regexp lookaround constra 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix enforcement of restrictions inside regexp lookaround constra @ 2015-11-07 17:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-11-07 17:43 UTC (permalink / raw) To: pgsql-committers Fix enforcement of restrictions inside regexp lookaround constraints. Lookahead and lookbehind constraints aren't allowed to contain backrefs, and parentheses within them are always considered non-capturing. Or so says the manual. But the regexp parser forgot about these rules once inside a parenthesized subexpression, so that constructs like (\w)(?=(\1)) were accepted (but then not correctly executed --- a case like this acted like (\w)(?=\w), without any enforcement that the two \w's match the same text). And in (?=((foo))) the innermost parentheses would be counted as capturing parentheses, though no text would ever be captured for them. To fix, properly pass down the "type" argument to the recursive invocation of parse(). Back-patch to all supported branches; it was agreed that silent misexecution of such patterns is worse than throwing an error, even though new errors in minor releases are generally not desirable. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/a43b4ab1111ca5e5f40a2ddd8e56bf999b9fdad9 Modified Files -------------- src/backend/regex/regcomp.c | 2 +- src/test/regress/expected/regex.out | 5 +++++ src/test/regress/sql/regex.sql | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix enforcement of restrictions inside regexp lookaround constra @ 2015-11-07 17:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-11-07 17:43 UTC (permalink / raw) To: pgsql-committers Fix enforcement of restrictions inside regexp lookaround constraints. Lookahead and lookbehind constraints aren't allowed to contain backrefs, and parentheses within them are always considered non-capturing. Or so says the manual. But the regexp parser forgot about these rules once inside a parenthesized subexpression, so that constructs like (\w)(?=(\1)) were accepted (but then not correctly executed --- a case like this acted like (\w)(?=\w), without any enforcement that the two \w's match the same text). And in (?=((foo))) the innermost parentheses would be counted as capturing parentheses, though no text would ever be captured for them. To fix, properly pass down the "type" argument to the recursive invocation of parse(). Back-patch to all supported branches; it was agreed that silent misexecution of such patterns is worse than throwing an error, even though new errors in minor releases are generally not desirable. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/44fc25153681f0d3814275926f3c626a3f283cc2 Modified Files -------------- src/backend/regex/regcomp.c | 2 +- src/test/regress/expected/regex.out | 5 +++++ src/test/regress/sql/regex.sql | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix enforcement of restrictions inside regexp lookaround constra @ 2015-11-07 17:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-11-07 17:43 UTC (permalink / raw) To: pgsql-committers Fix enforcement of restrictions inside regexp lookaround constraints. Lookahead and lookbehind constraints aren't allowed to contain backrefs, and parentheses within them are always considered non-capturing. Or so says the manual. But the regexp parser forgot about these rules once inside a parenthesized subexpression, so that constructs like (\w)(?=(\1)) were accepted (but then not correctly executed --- a case like this acted like (\w)(?=\w), without any enforcement that the two \w's match the same text). And in (?=((foo))) the innermost parentheses would be counted as capturing parentheses, though no text would ever be captured for them. To fix, properly pass down the "type" argument to the recursive invocation of parse(). Back-patch to all supported branches; it was agreed that silent misexecution of such patterns is worse than throwing an error, even though new errors in minor releases are generally not desirable. Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/f69c01f2c2b7dcd1b584ac1025d4739636a6cc83 Modified Files -------------- src/backend/regex/regcomp.c | 2 +- src/test/regress/expected/regex.out | 5 +++++ src/test/regress/sql/regex.sql | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix enforcement of restrictions inside regexp lookaround constra @ 2015-11-07 17:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-11-07 17:43 UTC (permalink / raw) To: pgsql-committers Fix enforcement of restrictions inside regexp lookaround constraints. Lookahead and lookbehind constraints aren't allowed to contain backrefs, and parentheses within them are always considered non-capturing. Or so says the manual. But the regexp parser forgot about these rules once inside a parenthesized subexpression, so that constructs like (\w)(?=(\1)) were accepted (but then not correctly executed --- a case like this acted like (\w)(?=\w), without any enforcement that the two \w's match the same text). And in (?=((foo))) the innermost parentheses would be counted as capturing parentheses, though no text would ever be captured for them. To fix, properly pass down the "type" argument to the recursive invocation of parse(). Back-patch to all supported branches; it was agreed that silent misexecution of such patterns is worse than throwing an error, even though new errors in minor releases are generally not desirable. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/8db652359c1739d4fc216d7f780c149671ed83c5 Modified Files -------------- src/backend/regex/regcomp.c | 2 +- src/test/regress/expected/regex.out | 5 +++++ src/test/regress/sql/regex.sql | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix enforcement of restrictions inside regexp lookaround constra @ 2015-11-07 17:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-11-07 17:43 UTC (permalink / raw) To: pgsql-committers Fix enforcement of restrictions inside regexp lookaround constraints. Lookahead and lookbehind constraints aren't allowed to contain backrefs, and parentheses within them are always considered non-capturing. Or so says the manual. But the regexp parser forgot about these rules once inside a parenthesized subexpression, so that constructs like (\w)(?=(\1)) were accepted (but then not correctly executed --- a case like this acted like (\w)(?=\w), without any enforcement that the two \w's match the same text). And in (?=((foo))) the innermost parentheses would be counted as capturing parentheses, though no text would ever be captured for them. To fix, properly pass down the "type" argument to the recursive invocation of parse(). Back-patch to all supported branches; it was agreed that silent misexecution of such patterns is worse than throwing an error, even though new errors in minor releases are generally not desirable. Branch ------ REL9_2_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/bfb10db81ec9f4d2cb8de20c6af03463f89154c9 Modified Files -------------- src/backend/regex/regcomp.c | 2 +- src/test/regress/expected/regex.out | 5 +++++ src/test/regress/sql/regex.sql | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix enforcement of restrictions inside regexp lookaround constra @ 2015-11-07 17:43 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2015-11-07 17:43 UTC (permalink / raw) To: pgsql-committers Fix enforcement of restrictions inside regexp lookaround constraints. Lookahead and lookbehind constraints aren't allowed to contain backrefs, and parentheses within them are always considered non-capturing. Or so says the manual. But the regexp parser forgot about these rules once inside a parenthesized subexpression, so that constructs like (\w)(?=(\1)) were accepted (but then not correctly executed --- a case like this acted like (\w)(?=\w), without any enforcement that the two \w's match the same text). And in (?=((foo))) the innermost parentheses would be counted as capturing parentheses, though no text would ever be captured for them. To fix, properly pass down the "type" argument to the recursive invocation of parse(). Back-patch to all supported branches; it was agreed that silent misexecution of such patterns is worse than throwing an error, even though new errors in minor releases are generally not desirable. Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/03ee6591dd305613a22902fb777a192fe1970adc Modified Files -------------- src/backend/regex/regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2015-11-07 17:43 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-11-07 17:43 pgsql: Fix enforcement of restrictions inside regexp lookaround constra Tom Lane <tgl@sss.pgh.pa.us> 2015-11-07 17:43 pgsql: Fix enforcement of restrictions inside regexp lookaround constra Tom Lane <tgl@sss.pgh.pa.us> 2015-11-07 17:43 pgsql: Fix enforcement of restrictions inside regexp lookaround constra Tom Lane <tgl@sss.pgh.pa.us> 2015-11-07 17:43 pgsql: Fix enforcement of restrictions inside regexp lookaround constra Tom Lane <tgl@sss.pgh.pa.us> 2015-11-07 17:43 pgsql: Fix enforcement of restrictions inside regexp lookaround constra Tom Lane <tgl@sss.pgh.pa.us> 2015-11-07 17:43 pgsql: Fix enforcement of restrictions inside regexp lookaround constra Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox