diff options
author | Neil Conway <neilc@samurai.com> | 2007-01-20 18:43:35 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2007-01-20 18:43:35 +0000 |
commit | 2b7334d4877ba445003f96b0bb7eed4e7078a39b (patch) | |
tree | 6828dfd02c4f2c20ee2d3c56d1e8f1242887c162 /src/backend/access/gist/gistscan.c | |
parent | 978fff79421ec1c36a1ec58092f1167ce22319b9 (diff) | |
download | postgresql-2b7334d4877ba445003f96b0bb7eed4e7078a39b.tar.gz postgresql-2b7334d4877ba445003f96b0bb7eed4e7078a39b.zip |
Refactor the index AM API slightly: move currentItemData and
currentMarkData from IndexScanDesc to the opaque structs for the
AMs that need this information (currently gist and hash).
Patch from Heikki Linnakangas, fixes by Neil Conway.
Diffstat (limited to 'src/backend/access/gist/gistscan.c')
-rw-r--r-- | src/backend/access/gist/gistscan.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c index 08ca73357c0..a275bb257ce 100644 --- a/src/backend/access/gist/gistscan.c +++ b/src/backend/access/gist/gistscan.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.66 2007/01/05 22:19:22 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.67 2007/01/20 18:43:35 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -42,12 +42,6 @@ gistrescan(PG_FUNCTION_ARGS) GISTScanOpaque so; int i; - /* - * Clear all the pointers. - */ - ItemPointerSetInvalid(&scan->currentItemData); - ItemPointerSetInvalid(&scan->currentMarkData); - so = (GISTScanOpaque) scan->opaque; if (so != NULL) { @@ -82,6 +76,12 @@ gistrescan(PG_FUNCTION_ARGS) scan->opaque = so; } + /* + * Clear all the pointers. + */ + ItemPointerSetInvalid(&so->curpos); + ItemPointerSetInvalid(&so->markpos); + /* Update scan key, if a new one is given */ if (key && scan->numberOfKeys > 0) { @@ -111,8 +111,8 @@ gistmarkpos(PG_FUNCTION_ARGS) *n, *tmp; - scan->currentMarkData = scan->currentItemData; so = (GISTScanOpaque) scan->opaque; + so->markpos = so->curpos; if (so->flags & GS_CURBEFORE) so->flags |= GS_MRKBEFORE; else @@ -160,8 +160,8 @@ gistrestrpos(PG_FUNCTION_ARGS) *n, *tmp; - scan->currentItemData = scan->currentMarkData; so = (GISTScanOpaque) scan->opaque; + so->curpos = so->markpos; if (so->flags & GS_MRKBEFORE) so->flags |= GS_CURBEFORE; else |