Commit 8b965c5
committed
compute_bitmap_pages' loop_count parameter should be double not int.
The value was double in the original implementation of this logic.
Commit da08a65 pulled it out into a subroutine, but carelessly
declared the parameter as int when it should have been double.
On most platforms, the only ill effect would be to clamp the value
to be not more than INT_MAX, which would seldom be exceeded and
probably wouldn't change the estimates too much anyway. Nonetheless,
it's wrong and can cause complaints from ubsan.
While here, improve the comments and parameter names.
This is an ABI change in a globally exposed subroutine, so
back-patching would create some risk of breaking extensions.
The value of the fix doesn't seem high enough to warrant taking
that risk, so fix in HEAD only.
Per report from Alexander Lakhin.
Discussion: https://postgr.es/m/f5e15fe1-202d-1936-f47c-f0c69a936b72@gmail.com1 parent 64b1fb5 commit 8b965c5
File tree
2 files changed
+17
-8
lines changed- src
- backend/optimizer/path
- include/optimizer
2 files changed
+17
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6393 | 6393 | | |
6394 | 6394 | | |
6395 | 6395 | | |
| 6396 | + | |
6396 | 6397 | | |
6397 | | - | |
| 6398 | + | |
| 6399 | + | |
| 6400 | + | |
| 6401 | + | |
| 6402 | + | |
| 6403 | + | |
| 6404 | + | |
6398 | 6405 | | |
6399 | 6406 | | |
6400 | | - | |
6401 | | - | |
| 6407 | + | |
| 6408 | + | |
| 6409 | + | |
6402 | 6410 | | |
6403 | 6411 | | |
6404 | 6412 | | |
| |||
6488 | 6496 | | |
6489 | 6497 | | |
6490 | 6498 | | |
6491 | | - | |
6492 | | - | |
6493 | | - | |
6494 | | - | |
| 6499 | + | |
| 6500 | + | |
| 6501 | + | |
| 6502 | + | |
6495 | 6503 | | |
6496 | 6504 | | |
6497 | 6505 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
0 commit comments