summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-12-03 22:43:01 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2010-12-03 22:43:01 -0500
commit04910a3ad5cd2901558da2a4fad9a2e2819348aa (patch)
tree9daaf9befed305761b7a75184547aad401e198bb /src/backend/access/gist/gistget.c
parent554506871bd3a73a5d9fa4ee3aa0b0fbf406f8ab (diff)
downloadpostgresql-04910a3ad5cd2901558da2a4fad9a2e2819348aa.tar.gz
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.
Diffstat (limited to 'src/backend/access/gist/gistget.c')
-rw-r--r--src/backend/access/gist/gistget.c4
1 files changed, 4 insertions, 0 deletions
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);