]> granicus.if.org Git - postgresql/commitdiff
1. Pass GISTENTRYs to giststate->penaltyFn by pointers, not by vals.
authorVadim B. Mikheev <vadim4o@yahoo.com>
Thu, 22 May 1997 16:01:33 +0000 (16:01 +0000)
committerVadim B. Mikheev <vadim4o@yahoo.com>
Thu, 22 May 1997 16:01:33 +0000 (16:01 +0000)
2. Re-initialize keys in gistrescan (if gist used in inner scan).

src/backend/access/gist/gist.c
src/backend/access/gist/gistscan.c

index cc14a2e44879b02c97c88c9114341a177d39fd76..f5338424c9037fa21c15592dde66f8757fe59fbf 100644 (file)
@@ -987,7 +987,7 @@ gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
        size = IndexTupleSize(datum) - sizeof(IndexTupleData);
        datum += sizeof(IndexTupleData);
        gistdentryinit(giststate,&entry,datum,r,p,i,size,FALSE);
-       (giststate->penaltyFn)(entry, identry, &usize);
+       (giststate->penaltyFn)(&entry, &identry, &usize);
        if (which_grow < 0 || usize < which_grow) {
            which = i;
            which_grow = usize;
index 4629de12922282fd207f1b71972e30e14be9b9a6..c877538472c79a714fce6a2430725b82414c07be 100644 (file)
@@ -118,6 +118,13 @@ gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
        gistfreestack(p->s_markstk);
        p->s_stack = p->s_markstk = (GISTSTACK *) NULL;
        p->s_flags = 0x0;
+       for (i = 0; i < s->numberOfKeys; i++)
+       {
+           s->keyData[i].sk_procedure 
+               = RelationGetGISTStrategy(s->relation, s->keyData[i].sk_attno, 
+                                         s->keyData[i].sk_procedure);
+           s->keyData[i].sk_func = p->giststate->consistentFn;
+       }
     } else {
        /* initialize opaque data */
        p = (GISTScanOpaque) palloc(sizeof(GISTScanOpaqueData));