Commit 9c4eceb4 authored by Bruce Momjian's avatar Bruce Momjian

Fix for vacuum updating problem.

parent 5fbbd364
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.70 1998/08/19 02:01:56 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.71 1998/08/19 15:47:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "storage/bufpage.h" #include "storage/bufpage.h"
#include "storage/shmem.h" #include "storage/shmem.h"
#include "storage/smgr.h" #include "storage/smgr.h"
#include "storage/itemptr.h"
#include "storage/lmgr.h" #include "storage/lmgr.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/inval.h" #include "utils/inval.h"
...@@ -1883,13 +1884,11 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst ...@@ -1883,13 +1884,11 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst
} }
/* XXX -- after write, should invalidate relcache in other backends */ /* XXX -- after write, should invalidate relcache in other backends */
#ifdef NOT_USED WriteNoReleaseBuffer(ItemPointerGetBlockNumber(&rtup->t_ctid));
WriteNoReleaseBuffer(&rtup->t_ctid); /* heap_endscan release scan' buffers ? */
#endif
/* /*
* invalidating system relations confuses the function cache of * invalidating system relations confuses the function cache of
* pg_operator and pg_opclass * pg_operator and pg_opclass, bjm
*/ */
if (!IsSystemRelationName(pgcform->relname.data)) if (!IsSystemRelationName(pgcform->relname.data))
RelationInvalidateHeapTuple(rd, rtup); RelationInvalidateHeapTuple(rd, rtup);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.24 1998/08/19 02:02:02 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.25 1998/08/19 15:47:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -143,9 +143,16 @@ IndexNext(IndexScan *node) ...@@ -143,9 +143,16 @@ IndexNext(IndexScan *node)
buffer, /* buffer associated with tuple */ buffer, /* buffer associated with tuple */
false); /* don't pfree */ false); /* don't pfree */
/*
* We must check to see if the current tuple would have been
* matched by an earlier index, so we don't double report it.
* We do this by passing the tuple through ExecQual and look
* for failure with all previous qualifications.
*/
for (prev_index = 0; prev_index < indexstate->iss_IndexPtr; for (prev_index = 0; prev_index < indexstate->iss_IndexPtr;
prev_index++) prev_index++)
{ {
scanstate->cstate.cs_ExprContext->ecxt_scantuple = slot;
if (ExecQual(nth(prev_index, node->indxqual), if (ExecQual(nth(prev_index, node->indxqual),
scanstate->cstate.cs_ExprContext)) scanstate->cstate.cs_ExprContext))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment