forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit18ac08f
committed
Use min/max bounds defined by Zstd for compression level
The bounds hardcoded in compression.c sinceffd5365 (minimum at 1 andmaximum at 22) do not match the reality of what zstd is able tohandle, these values being available via ZSTD_maxCLevel() andZSTD_minCLevel() at run-time. The maximum of 22 is actually correctin recent versions, but the minimum was not as the library can go downto -131720 by design. This commit changes the code to use the run-timevalues in the code instead of some hardcoded ones.Zstd seems to assume that these bounds could change in the future, andPostgres will be able to adapt automatically to such changes thanks towhat's being done in this commit.Reported-by: Justin PrysbyDiscussion:https://postgr.es/m/20220922033716.GL31833@telsasoft.comBackpatch-through: 151 parentcbe6dd1 commit18ac08f
2 files changed
+6
-3
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2757 | 2757 |
| |
2758 | 2758 |
| |
2759 | 2759 |
| |
2760 |
| - | |
2761 |
| - | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
2762 | 2764 |
| |
2763 | 2765 |
| |
2764 | 2766 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
324 | 324 |
| |
325 | 325 |
| |
326 | 326 |
| |
327 |
| - | |
328 | 327 |
| |
| 328 | + | |
| 329 | + | |
329 | 330 |
| |
330 | 331 |
| |
331 | 332 |
| |
|
0 commit comments
Comments
(0)