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.
This commit is contained in:
Tom Lane 2010-12-03 22:43:01 -05:00
parent 554506871b
commit 04910a3ad5

View File

@ -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);