From: Tom Lane Date: Sat, 4 Dec 2010 03:43:01 +0000 (-0500) Subject: Put back gistgettuple's check for backwards scan request. X-Git-Tag: REL9_1_ALPHA3~94 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04910a3ad5cd2901558da2a4fad9a2e2819348aa;p=postgresql Put back gistgettuple's check for backwards scan request. On reflection it's a bad idea for the KNNGIST patch to have removed that. We don't want it silently returning incorrect answers. --- diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index f0418a08af..afff55c788 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -459,8 +459,12 @@ Datum gistgettuple(PG_FUNCTION_ARGS) { IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0); + ScanDirection dir = (ScanDirection) PG_GETARG_INT32(1); GISTScanOpaque so = (GISTScanOpaque) scan->opaque; + if (dir != ForwardScanDirection) + elog(ERROR, "GiST only supports forward scan direction"); + if (!so->qual_ok) PG_RETURN_BOOL(false);