pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pageinspect: Change block number arguments to bigint
Date: Tue, 19 Jan 2021 10:05:08 +0000
Message-ID: <E1l1nsq-0000IO-HZ@gemulon.postgresql.org> (raw)

pageinspect: Change block number arguments to bigint

Block numbers are 32-bit unsigned integers.  Therefore, the smallest
SQL integer type that they can fit in is bigint.  However, in the
pageinspect module, most input and output parameters dealing with
block numbers were declared as int.  The behavior with block numbers
larger than a signed 32-bit integer was therefore dubious.  Change
these arguments to type bigint and add some more explicit error
checking on the block range.

(Other contrib modules appear to do this correctly already.)

Since we are changing argument types of existing functions, in order
to not misbehave if the binary is updated before the extension is
updated, we need to create new C symbols for the entry points, similar
to how it's done in other extensions as well.

Reported-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/d8f6bdd536df403b9b33816e9f7e0b9d@G08CNEXMBPEKD05.g08.fuji...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f18aa1b203930ed28cfe42e82d3418ae6277576d

Modified Files
--------------
contrib/pageinspect/Makefile                    |  2 +-
contrib/pageinspect/brinfuncs.c                 | 13 ++++-
contrib/pageinspect/btreefuncs.c                | 76 ++++++++++++++++++------
contrib/pageinspect/expected/btree.out          |  6 ++
contrib/pageinspect/expected/gin.out            |  1 +
contrib/pageinspect/expected/hash.out           |  4 ++
contrib/pageinspect/expected/oldextversions.out | 40 +++++++++++++
contrib/pageinspect/expected/page.out           |  4 ++
contrib/pageinspect/hashfuncs.c                 | 11 +++-
contrib/pageinspect/pageinspect--1.8--1.9.sql   | 77 +++++++++++++++++++++++++
contrib/pageinspect/pageinspect.h               |  9 +++
contrib/pageinspect/rawpage.c                   | 75 +++++++++++++++++++++++-
contrib/pageinspect/sql/btree.sql               |  3 +
contrib/pageinspect/sql/gin.sql                 |  2 +
contrib/pageinspect/sql/hash.sql                |  2 +
contrib/pageinspect/sql/oldextversions.sql      | 20 +++++++
contrib/pageinspect/sql/page.sql                |  2 +
doc/src/sgml/pageinspect.sgml                   | 12 ++--
18 files changed, 328 insertions(+), 31 deletions(-)



Message-ID: <E1l1nsq-0000IO-HZ@gemulon.postgresql.org>
Permalink:  ../E1l1nsq-0000IO-HZ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l1nsq-0000IO-HZ@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: pageinspect: Change block number arguments to bigint
  In-Reply-To: <E1l1nsq-0000IO-HZ@gemulon.postgresql.org>
  References: <E1l1nsq-0000IO-HZ@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