- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitae42744
committed
Fix pgstatindex() to give consistent results for empty indexes.
For an empty index, the pgstatindex() function would compute 0.0/0.0 forits avg_leaf_density and leaf_fragmentation outputs. On machines thatfollow the IEEE float arithmetic standard with any care, that results ina NaN. However, per report from Rushabh Lathia, Microsoft couldn'tmanage to get this right, so you'd get a bizarre error on Windows.Fix by forcing the results to be NaN explicitly, rather than relying onthe division operator to give that or the snprintf function to print itcorrectly. I have some doubts that this is really the most usefuldefinition, but it seems better to remain backward-compatible withthose platforms for which the behavior wasn't completely broken.Back-patch to 8.2, since the code is like that in all current releases.1 parent6016005 commitae42744
1 file changed
+10
-2
lines changedLines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
377 | 377 |
| |
378 | 378 |
| |
379 | 379 |
| |
380 |
| - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
381 | 385 |
| |
382 |
| - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
383 | 391 |
| |
384 | 392 |
| |
385 | 393 |
| |
|
0 commit comments
Comments
(0)