Content-Length: 272119 | pFad | http://github.com/postgrespro/postgres/commit/2de3c1015cb2556af501c630b1768a20f111fe95

1E Fix datatype confusion in logtape.c's right_offset(). · postgrespro/postgres@2de3c10 · GitHub
Skip to content

Commit 2de3c10

Browse files
committed
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 c02fdc9). In passing, also make swap_nodes() use consistent datatypes. Ma Liangzhu Discussion: https://postgr.es/m/17336-fc4e522d26a750fd@postgresql.org
1 parent ece8c76 commit 2de3c10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/sort/logtape.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ ltsReadFillBuffer(LogicalTape *lt)
343343
static inline void
344344
swap_nodes(long *heap, unsigned long a, unsigned long b)
345345
{
346-
unsigned long swap;
346+
long swap;
347347

348348
swap = heap[a];
349349
heap[a] = heap[b];
@@ -357,7 +357,7 @@ left_offset(unsigned long i)
357357
}
358358

359359
static inline unsigned long
360-
right_offset(unsigned i)
360+
right_offset(unsigned long i)
361361
{
362362
return 2 * i + 2;
363363
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/2de3c1015cb2556af501c630b1768a20f111fe95

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy