forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit063dd37
committed
Short-circuit slice requests that are for more than the object's size.
substring(), and perhaps other callers, isn't careful to pass aslice length that is no more than the datum's true size. Sincetoast_decompress_datum_slice's children will palloc the requestedslice length, this can waste memory. Also, close study of the liblz4documentation suggests that it is dependent on the caller to not askfor more than the correct amount of decompressed data; this squareswith observed misbehavior with liblz4 1.8.3. Avoid these problemsby switching to the normal full-decompression code path if theslice request is >= datum's decompressed size.Tom Lane and Dilip KumarDiscussion:https://postgr.es/m/507597.1616370729@sss.pgh.pa.us1 parentaeb1631 commit063dd37
File tree
2 files changed
+13
-0
lines changed- src
- backend/access/common
- include/access
2 files changed
+13
-0
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
506 | 506 |
| |
507 | 507 |
| |
508 | 508 |
| |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
509 | 520 |
| |
510 | 521 |
| |
511 | 522 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
| 35 | + | |
34 | 36 |
| |
35 | 37 |
| |
36 | 38 |
| |
|
0 commit comments
Comments
(0)