From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check the snapshot argument of index_beginscan and family
Date: Tue, 06 Dec 2022 00:29:33 +0000
Message-ID: <E1p2Lq0-002APQ-Sw@gemulon.postgresql.org> (raw)
Check the snapshot argument of index_beginscan and family
Passing a NULL snapshot (InvalidSnapshot) is going to work but only as long
as the index can't find any matching rows. This can be confusing for
the extension authors, so add an explicit check for this argument. The check
is implemented with Assert() in order to avoid overhead in release builds.
Reported-by: Sven Klemm
Discussion: https://postgr.es/m/CAJ7c6TPxitD4vbKyP-mpmC1XwyHdPPqvjLzm%2BVpB88h8LGgneQ%40mail.gmail.com
Author: Aleksander Alekseev
Reviewed-by: Pavel Borisov
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/941aa6a6268a6a66f6895401aad6b5329111d412
Modified Files
--------------
src/backend/access/index/indexam.c | 8 ++++++++
1 file changed, 8 insertions(+)
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: akorotkov@postgresql.org
Subject: Re: pgsql: Check the snapshot argument of index_beginscan and family
In-Reply-To: <E1p2Lq0-002APQ-Sw@gemulon.postgresql.org>
References: <E1p2Lq0-002APQ-Sw@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