]> granicus.if.org Git - postgresql/commitdiff
Repair logic error for multi-key indexes. From Oleg Bartunov.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 28 Jun 2001 16:00:07 +0000 (16:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 28 Jun 2001 16:00:07 +0000 (16:00 +0000)
src/backend/access/gist/gistscan.c

index 362b489dac090b0500f5ef7ba6edc24a935946ef..672b121693a6e1b05d3344eec8dcc841036a63d6 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/access/gist/gistscan.c,v 1.36 2001/06/09 18:16:55 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/access/gist/gistscan.c,v 1.37 2001/06/28 16:00:07 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -117,7 +117,7 @@ gistrescan(PG_FUNCTION_ARGS)
                        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[i];
+                       s->keyData[i].sk_func = p->giststate->consistentFn[s->keyData[i].sk_attno-1];
                }
        }
        else
@@ -148,7 +148,7 @@ gistrescan(PG_FUNCTION_ARGS)
                                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[i];
+                               s->keyData[i].sk_func = p->giststate->consistentFn[s->keyData[i].sk_attno-1];
                        }
        }