postgresql/src/test/modules
Tom Lane 9bbf6f7341 Prevent regexp back-refs from sometimes matching when they shouldn't.
The recursion in cdissect() was careless about clearing match data
for capturing parentheses after rejecting a partial match.  This
could allow a later back-reference to succeed when by rights it
should fail for lack of a defined referent.

To fix, think a little more rigorously about what the contract
between different levels of cdissect's recursion needs to be.
With the right spec, we can fix this using fewer rather than more
resets of the match data; the key decision being that a failed
sub-match is now explicitly responsible for clearing any matches
it may have set.

There are enough other cross-checks and optimizations in the code
that it's not especially easy to exhibit this problem; usually, the
match will fail as-expected.  Plus, regexps that are even potentially
vulnerable are most likely user errors, since there's just not much
point in writing a back-ref that doesn't always have a referent.
These facts perhaps explain why the issue hasn't been detected,
even though it's almost certainly a couple of decades old.

Discussion: https://postgr.es/m/151435.1629733387@sss.pgh.pa.us
2021-08-23 17:41:07 -04:00
..
brin Unify PostgresNode's new() and get_new_node() methods 2021-07-29 05:58:08 -04:00
commit_ts Unify PostgresNode's new() and get_new_node() methods 2021-07-29 05:58:08 -04:00
delay_execution Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
dummy_index_am Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
dummy_seclabel Update copyright for 2021 2021-01-02 13:06:25 -05:00
libpq_pipeline Unify PostgresNode's new() and get_new_node() methods 2021-07-29 05:58:08 -04:00
plsample Update copyright for 2021 2021-01-02 13:06:25 -05:00
snapshot_too_old Improve display of query results in isolation tests. 2021-06-23 11:13:00 -04:00
spgist_name_ops Prevent infinite insertion loops in spgdoinsert(). 2021-05-14 15:07:34 -04:00
ssl_passphrase_callback Silence perl warning about uninitialized value 2021-08-01 13:03:15 -04:00
test_bloomfilter Update copyright for 2021 2021-01-02 13:06:25 -05:00
test_ddl_deparse Update copyright for 2021 2021-01-02 13:06:25 -05:00
test_extensions Fix use-after-free bug with event triggers in an extension script 2020-09-15 21:03:14 -03:00
test_ginpostinglist Update copyright for 2021 2021-01-02 13:06:25 -05:00
test_integerset Update copyright for 2021 2021-01-02 13:06:25 -05:00
test_misc Unify PostgresNode's new() and get_new_node() methods 2021-07-29 05:58:08 -04:00
test_parser Update copyright for 2021 2021-01-02 13:06:25 -05:00
test_pg_dump Unify PostgresNode's new() and get_new_node() methods 2021-07-29 05:58:08 -04:00
test_predtest Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
test_rbtree Update copyright for 2021 2021-01-02 13:06:25 -05:00
test_regex Prevent regexp back-refs from sometimes matching when they shouldn't. 2021-08-23 17:41:07 -04:00
test_rls_hooks Update copyright for 2021 2021-01-02 13:06:25 -05:00
test_shm_mq Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:20:16 +09:00
unsafe_tests Add primary keys and unique constraints to system catalogs 2021-01-30 19:44:29 +01:00
worker_spi Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Fix confusion in SP-GiST between attribute type and leaf storage type. 2021-04-04 14:28:57 -04:00
README Add an enforcement mechanism for global object names in regression tests. 2019-06-29 11:34:00 -04:00

Test extensions and libraries
=============================

src/test/modules contains PostgreSQL extensions that are primarily or entirely
intended for testing PostgreSQL and/or to serve as example code. The extensions
here aren't intended to be installed in a production server and aren't suitable
for "real work".

Furthermore, while you can do "make install" and "make installcheck" in
this directory or its children, it is NOT ADVISABLE to do so with a server
containing valuable data.  Some of these tests may have undesirable
side-effects on roles or other global objects within the tested server.
"make installcheck-world" at the top level does not recurse into this
directory.

Most extensions have their own pg_regress tests or isolationtester specs. Some
are also used by tests elsewhere in the tree.

If you're adding new hooks or other functionality exposed as C-level API this
is where to add the tests for it.