pgsql: Check the snapshot argument of index_beginscan and family - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Check the snapshot argument of index_beginscan and family
Date
Msg-id E1p2Lq0-002APQ-Sw@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(+)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Provide test coverage in pg_dump for default behaviors with comp
Next
From: Michael Paquier
Date:
Subject: pgsql: Generate pg_stat_get*() functions for tables using macros