pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make rs_cindex and rs_ntuples unsigned
Date: Wed, 18 Dec 2024 16:48:36 +0000
Message-ID: <E1tNxDv-000Dcq-KK@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/68d9662be1c4b705123a0e292974fb4be661294c

Modified Files
--------------
src/backend/access/heap/heapam.c         | 7 +++++--
src/backend/access/heap/heapam_handler.c | 2 +-
src/include/access/heapam.h              | 4 ++--
3 files changed, 8 insertions(+), 5 deletions(-)



Message-ID: <E1tNxDv-000Dcq-KK@gemulon.postgresql.org>
Permalink:  ../E1tNxDv-000Dcq-KK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tNxDv-000Dcq-KK@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make rs_cindex and rs_ntuples unsigned
  In-Reply-To: <E1tNxDv-000Dcq-KK@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox