pgsql: pageinspect: Change block number arguments to bigint - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: pageinspect: Change block number arguments to bigint
Date
Msg-id E1l1nsq-0000IO-HZ@gemulon.postgresql.org
Whole thread Raw
List 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.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.fujitsu.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(-)


pgsql-committers by date:

Previous
From: Fujii Masao
Date:
Subject: pgsql: doc: Add note about the server name of postgres_fdw_get_connecti
Next
From: Tom Lane
Date:
Subject: pgsql: Remove faulty support for MergeAppend plan with WHERE CURRENT OF