pgsql: pageinspect: Change block number arguments to bigint

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pageinspect: Change block number arguments to bigint
Date: 2021-01-19 10:05:08
Message-ID: E1l1nsq-0000IO-HZ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)bapat(dot)oss(at)gmail(dot)com>
Reviewed-by: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://www.postgresql.org/message-id/flat/d8f6bdd536df403b9b33816e9f7e0b9d(at)G08CNEXMBPEKD05(dot)g08(dot)fujitsu(dot)local

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-01-19 18:26:32 pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF
Previous Message Fujii Masao 2021-01-19 06:05:44 pgsql: doc: Add note about the server name of postgres_fdw_get_connecti