aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/heapam.h
diff options
context:
space:
mode:
authorMelanie Plageman <melanieplageman@gmail.com>2024-12-18 11:47:38 -0500
committerMelanie Plageman <melanieplageman@gmail.com>2024-12-18 11:47:38 -0500
commit68d9662be1c4b705123a0e292974fb4be661294c (patch)
tree1e11a6b5953fe7ccc81c01c11168ff1b0d7e2358 /src/include/access/heapam.h
parent1f0de66ea2a5549a3768c67434e28a136c280571 (diff)
downloadpostgresql-68d9662be1c4b705123a0e292974fb4be661294c.tar.gz
postgresql-68d9662be1c4b705123a0e292974fb4be661294c.zip
Make rs_cindex and rs_ntuples unsigned
HeapScanDescData.rs_cindex and rs_ntuples can't be less than 0. All scan types using the heap scan descriptor expect these values to be >= 0. Make that expectation clear by making rs_cindex and rs_ntuples unsigned. Also remove the test in heapam_scan_bitmap_next_tuple() that checks if rs_cindex < 0. This was never true, but now that rs_cindex is unsigned, it makes even less sense. While we are at it, initialize both rs_cindex and rs_ntuples to 0 in initscan(). Author: Melanie Plageman Reviewed-by: Dilip Kumar Discussion: https://postgr.es/m/CAAKRu_ZxF8cDCM_BFi_L-t%3DRjdCZYP1usd1Gd45mjHfZxm0nZw%40mail.gmail.com
Diffstat (limited to 'src/include/access/heapam.h')
-rw-r--r--src/include/access/heapam.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h
index 96cf82f97b7..04afb1a6a66 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -103,8 +103,8 @@ typedef struct HeapScanDescData
int rs_empty_tuples_pending;
/* these fields only used in page-at-a-time mode and for bitmap scans */
- int rs_cindex; /* current tuple's index in vistuples */
- int rs_ntuples; /* number of visible tuples on page */
+ uint32 rs_cindex; /* current tuple's index in vistuples */
+ uint32 rs_ntuples; /* number of visible tuples on page */
OffsetNumber rs_vistuples[MaxHeapTuplesPerPage]; /* their offsets */
} HeapScanDescData;
typedef struct HeapScanDescData *HeapScanDesc;