postgresql/src/test/modules
Michael Paquier 341e9a05e7 Fix two NULL pointer dereferences when reading custom pgstats from file
There were two spots in pgstat_read_statsfile() where is was possible to
finish with a null-pointer-dereference crash for custom pgstats kinds:
- When reading stats for a fixed-numbered stats entry.
- When reading a variable stats entry with name serialization.
For both cases, these issues were reachable by starting a server after
changing shared_preload_libraries so as the stats written previously
could not be loaded.

The code is changed so as the stats are ignored in this case, like the
other code paths doing similar sanity checks.  Two WARNINGs are added to
be able to debug these issues.  A test is added for the case of
fixed-numbered stats with the module injection_points.

Oversights in 7949d95945, spotted while looking at a different report.

Discussion: https://postgr.es/m/Ztj0Jftsn4xXuXtl@paquier.xyz
2024-09-05 14:36:57 +09:00
..
brin Update copyright for 2024 2024-01-03 20:49:05 -05:00
commit_ts Revise GUC names quoting in messages again 2024-05-17 11:44:26 +02:00
delay_execution Update copyright for 2024 2024-01-03 20:49:05 -05:00
dummy_index_am Convert some extern variables to static 2024-07-02 07:26:22 +02:00
dummy_seclabel Update copyright for 2024 2024-01-03 20:49:05 -05:00
gin Make GIN tests using injection points concurrent-safe 2024-04-10 13:48:13 +09:00
injection_points Fix two NULL pointer dereferences when reading custom pgstats from file 2024-09-05 14:36:57 +09:00
ldap_password_func Remove _PG_fini() 2024-08-21 07:24:03 +09:00
libpq_pipeline Convert some extern variables to static 2024-07-02 07:26:22 +02:00
plsample Update copyright for 2024 2024-01-03 20:49:05 -05:00
spgist_name_ops Update copyright for 2024 2024-01-03 20:49:05 -05:00
ssl_passphrase_callback Cleanup perl code from unused variables and routines 2024-07-02 09:47:16 +09:00
test_bloomfilter Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_copy_callbacks Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_custom_rmgrs Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_ddl_deparse Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
test_dsa Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
test_dsm_registry Introduce the dynamic shared memory registry. 2024-01-19 14:24:36 -06:00
test_extensions Repair ALTER EXTENSION ... SET SCHEMA. 2024-05-09 12:19:52 -04:00
test_ginpostinglist Fix some typos 2024-01-22 13:55:25 +09:00
test_integerset Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_json_parser Make nullSemAction const, add 'const' decorators to related functions 2024-08-06 23:04:22 +03:00
test_lfind Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_misc Check availability of module injection_points in TAP tests 2024-09-05 13:29:43 +09:00
test_oat_hooks Fix search_path to a safe value during maintenance operations. 2024-03-04 17:31:38 -08:00
test_parser Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_pg_dump Improve tracking of role dependencies of pg_init_privs entries. 2024-06-17 12:55:10 -04:00
test_predtest Tighten test_predtest's input checks, and improve error messages. 2024-06-07 16:45:56 -04:00
test_radixtree Pre-beta mechanical code beautification. 2024-05-14 16:34:50 -04:00
test_rbtree Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_regex Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_resowner Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
test_rls_hooks Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_shm_mq Revise GUC names quoting in messages again 2024-05-17 11:44:26 +02:00
test_slru Simplify makefiles exporting twice enable_injection_points 2024-09-04 08:05:44 +09:00
test_tidstore Refactor tidstore.c iterator buffering. 2024-07-24 17:32:35 +12:00
unsafe_tests Update copyright for 2024 2024-01-03 20:49:05 -05:00
worker_spi Fix a series of typos and outdated references 2024-08-12 23:27:09 +12:00
xid_wraparound Fix rarely-run test for message wording change 2024-09-02 17:40:32 +02:00
Makefile Revert: Custom reloptions for table AM 2024-04-11 15:46:35 +03:00
meson.build Revert: Custom reloptions for table AM 2024-04-11 15:46:35 +03: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.