diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2021-02-18 22:38:55 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2021-02-18 22:38:55 -0500 |
commit | b5a66e7353ba65c11c5fc6a79b72213bde8dbe44 (patch) | |
tree | 33b57ccfd288547ddad91b19381c9abe65a115b9 /src/test/modules/test_regex/sql/test_regex.sql | |
parent | 614b7f18b3bda738f352a8732cf749eb5fa56dae (diff) | |
download | postgresql-b5a66e7353ba65c11c5fc6a79b72213bde8dbe44.tar.gz postgresql-b5a66e7353ba65c11c5fc6a79b72213bde8dbe44.zip |
Fix another ancient bug in parsing of BRE-mode regular expressions.
While poking at the regex code, I happened to notice that the bug
squashed in commit afcc8772e had a sibling: next() failed to return
a specific value associated with the '}' token for a "\{m,n\}"
quantifier when parsing in basic RE mode. Again, this could result
in treating the quantifier as non-greedy, which it never should be in
basic mode. For that to happen, the last character before "\}" that
sets "nextvalue" would have to set it to zero, or it'd have to have
accidentally been zero from the start. The failure can be provoked
repeatably with, for example, a bound ending in digit "0".
Like the previous patch, back-patch all the way.
Diffstat (limited to 'src/test/modules/test_regex/sql/test_regex.sql')
-rw-r--r-- | src/test/modules/test_regex/sql/test_regex.sql | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/modules/test_regex/sql/test_regex.sql b/src/test/modules/test_regex/sql/test_regex.sql index ae7d6b43e4a..31e947ee9c6 100644 --- a/src/test/modules/test_regex/sql/test_regex.sql +++ b/src/test/modules/test_regex/sql/test_regex.sql @@ -214,8 +214,9 @@ select * from test_regex('a?*', '', '-'); select * from test_regex('a+*', '', '-'); -- expectError 7.15 - a*+ BADRPT select * from test_regex('a*+', '', '-'); --- test for ancient brenext() bug; not currently in Tcl +-- tests for ancient brenext() bugs; not currently in Tcl select * from test_regex('.*b', 'aaabbb', 'b'); +select * from test_regex('.\{1,10\}', 'abcdef', 'bQ'); -- doing 8 "braces" |