forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0a80e88
committed
Fix incorrect return value for pg_size_pretty(bigint)
pg_size_pretty(bigint) would return the value in bytes rather than PBfor the smallest-most bigint value. This happened due to an incorrectassumption that the absolute value of -9223372036854775808 could bestored inside a signed 64-bit type.Here we fix that by instead storing that value in an unsigned 64-bit type.This bug does exist in versions prior to 15 but the code there issufficiently different and the bug seems sufficiently non-critical thatit does not seem worth risking backpatching further.Author: Joseph Koshakow <koshy44@gmail.com>Discussion:https://postgr.es/m/CAAvxfHdTsMZPWEHUrZ=h3cky9Ccc3Mtx2whUHygY+ABP-mCmUw@mail.gmail.comBackpatch-through: 151 parent6ddc855 commit0a80e88
File tree
3 files changed
+18
-2
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+18
-2
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
562 | 562 |
| |
563 | 563 |
| |
564 | 564 |
| |
| 565 | + | |
565 | 566 |
| |
566 |
| - | |
567 |
| - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
568 | 572 |
| |
569 | 573 |
| |
570 | 574 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 |
| |
83 | 91 |
| |
84 | 92 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 |
| |
31 | 35 |
| |
32 | 36 |
| |
|
0 commit comments
Comments
(0)