Fix datatype confusion in logtape.c's right_offset().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Dec 2021 16:46:36 +0000 (11:46 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Dec 2021 16:46:36 +0000 (11:46 -0500)
commit2de3c1015cb2556af501c630b1768a20f111fe95
tree52bcfaf18aaef3395fcc28528dc2d5d7ea514275
parentece8c76192fee0b78509688325631ceabca44ff5
Fix datatype confusion in logtape.c's right_offset().

This could only matter if (a) long is wider than int, and (b) the heap
of free blocks exceeds UINT_MAX entries, which seems pretty unlikely.
Still, it's a theoretical bug, so backpatch to v13 where the typo came
in (in commit c02fdc922).

In passing, also make swap_nodes() use consistent datatypes.

Ma Liangzhu

Discussion: https://postgr.es/m/17336-fc4e522d26a750fd@postgresql.org
src/backend/utils/sort/logtape.c