postgresql/src/backend/utils/cache
Jeff Davis edd9a2bf74 Fix assign_record_type_typmod().
If an error occurred in the wrong place, it was possible to leave an
unintialized entry in the hash table, leading to a crash. Fixed.

Also, be more careful about the order of operations so that an
allocation error doesn't leak memory in CacheMemoryContext or
unnecessarily advance NextRecordTypmod.

Backpatch through version 11. Earlier versions (prior to 35ea75632a)
do not exhibit the problem, because an uninitialized hash entry
contains a valid empty list.

Author: Sait Talha Nisanci <Sait.Nisanci@microsoft.com>
Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/HE1PR8303MB009069D476225B9A9E194B8891779@HE1PR8303MB0090.EURPRD83.prod.outlook.com
Backpatch-through: 11
2021-07-10 10:27:27 -07:00
..
attoptcache.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
catcache.c Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
evtcache.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
inval.c Fix inconsistent code with shared invalidations of snapshots 2020-12-28 22:16:57 +09:00
lsyscache.c Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY 2021-02-10 13:09:09 +09:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
partcache.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
plancache.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
relcache.c Reduce overhead of cache-clobber testing in LookupOpclassInfo(). 2021-07-05 16:51:57 -04:00
relfilenodemap.c Spelling adjustments 2020-06-07 15:06:51 +02:00
relmapper.c Another fix to relmapper race condition. 2021-06-24 11:19:31 +03:00
spccache.c Introduce a maintenance_io_concurrency setting. 2020-03-16 17:14:26 +13:00
syscache.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
ts_cache.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
typcache.c Fix assign_record_type_typmod(). 2021-07-10 10:27:27 -07:00