postgresql/src/backend/access/common
Tom Lane 063dd37ebc Short-circuit slice requests that are for more than the object's size.
substring(), and perhaps other callers, isn't careful to pass a
slice length that is no more than the datum's true size.  Since
toast_decompress_datum_slice's children will palloc the requested
slice length, this can waste memory.  Also, close study of the liblz4
documentation suggests that it is dependent on the caller to not ask
for more than the correct amount of decompressed data; this squares
with observed misbehavior with liblz4 1.8.3.  Avoid these problems
by switching to the normal full-decompression code path if the
slice request is >= datum's decompressed size.

Tom Lane and Dilip Kumar

Discussion: https://postgr.es/m/507597.1616370729@sss.pgh.pa.us
2021-03-22 14:01:20 -04:00
..
Makefile Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00
attmap.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
bufmask.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
detoast.c Short-circuit slice requests that are for more than the object's size. 2021-03-22 14:01:20 -04:00
heaptuple.c Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
indextuple.c Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00
printsimple.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
printtup.c Remove server and libpq support for old FE/BE protocol version 2. 2021-03-04 10:45:55 +02:00
relation.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
reloptions.c Add a new GUC and a reloption to enable inserts in parallel-mode. 2021-03-18 07:25:27 +05:30
scankey.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
session.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
syncscan.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
toast_compression.c Mostly-cosmetic adjustments of TOAST-related macros. 2021-03-22 13:43:10 -04:00
toast_internals.c Mostly-cosmetic adjustments of TOAST-related macros. 2021-03-22 13:43:10 -04:00
tupconvert.c Fix permission checks on constraint violation errors on partitions. 2021-02-08 11:01:51 +02:00
tupdesc.c Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00