mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
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:
@ -459,8 +459,12 @@ Datum
|
|||||||
gistgettuple(PG_FUNCTION_ARGS)
|
gistgettuple(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0);
|
IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0);
|
||||||
|
ScanDirection dir = (ScanDirection) PG_GETARG_INT32(1);
|
||||||
GISTScanOpaque so = (GISTScanOpaque) scan->opaque;
|
GISTScanOpaque so = (GISTScanOpaque) scan->opaque;
|
||||||
|
|
||||||
|
if (dir != ForwardScanDirection)
|
||||||
|
elog(ERROR, "GiST only supports forward scan direction");
|
||||||
|
|
||||||
if (!so->qual_ok)
|
if (!so->qual_ok)
|
||||||
PG_RETURN_BOOL(false);
|
PG_RETURN_BOOL(false);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user