Skip to content

Commit 4c0ec9e

Browse files
committed
Use platform independent type for TupleTableSlot->tts_off.
Previously tts_off was, for unknown reasons, of type long. For one that's unnecessary as tuples are restricted in length, for another long would be a bad choice of type even if that weren't the case, as it's not reliably wider than an int. Also HeapTupleHeader->t_len is a uint32. This is split off from a larger patch implementing JITed tuple deforming. Seems like an independent improvement, as tiny as it is. Author: Andres Freund
1 parent c2ff42c commit 4c0ec9e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/backend/access/common/heaptuple.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc,
942942
int natts; /* number of atts to extract */
943943
int attnum;
944944
char *tp; /* ptr to tuple data */
945-
long off; /* offset in tuple data */
945+
uint32 off; /* offset in tuple data */
946946
bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
947947
bool slow = false; /* can we use/set attcacheoff? */
948948

@@ -1043,7 +1043,7 @@ slot_deform_tuple(TupleTableSlot *slot, int natts)
10431043
bool hasnulls = HeapTupleHasNulls(tuple);
10441044
int attnum;
10451045
char *tp; /* ptr to tuple data */
1046-
long off; /* offset in tuple data */
1046+
uint32 off; /* offset in tuple data */
10471047
bits8 *bp = tup->t_bits; /* ptr to null bitmap in tuple */
10481048
bool slow; /* can we use/set attcacheoff? */
10491049

src/include/executor/tuptable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ typedef struct TupleTableSlot
126126
bool *tts_isnull; /* current per-attribute isnull flags */
127127
MinimalTuple tts_mintuple; /* minimal tuple, or NULL if none */
128128
HeapTupleData tts_minhdr; /* workspace for minimal-tuple-only case */
129-
long tts_off; /* saved state for slot_deform_tuple */
129+
uint32 tts_off; /* saved state for slot_deform_tuple */
130130
bool tts_fixedTupleDescriptor; /* descriptor can't be changed */
131131
} TupleTableSlot;
132132

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy