aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-08-19 15:47:36 +0000
committerBruce Momjian <bruce@momjian.us>1998-08-19 15:47:36 +0000
commit9c4eceb4e35e793b0ff882907755618371aecc8b (patch)
treede3b52b5970f9d3f296560d2535e19d532a4ccdb /src
parent5fbbd364e8083d4fea8b5471dcecb95c50674c3d (diff)
downloadpostgresql-9c4eceb4e35e793b0ff882907755618371aecc8b.tar.gz
postgresql-9c4eceb4e35e793b0ff882907755618371aecc8b.zip
Fix for vacuum updating problem.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/vacuum.c9
-rw-r--r--src/backend/executor/nodeIndexscan.c13
2 files changed, 14 insertions, 8 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index bf2752dfa92..7b922e09504 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -7,7 +7,7 @@
*
*
* 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 @@
#include "storage/bufpage.h"
#include "storage/shmem.h"
#include "storage/smgr.h"
+#include "storage/itemptr.h"
#include "storage/lmgr.h"
#include "utils/builtins.h"
#include "utils/inval.h"
@@ -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 */
-#ifdef NOT_USED
- WriteNoReleaseBuffer(&rtup->t_ctid); /* heap_endscan release scan' buffers ? */
-#endif
+ WriteNoReleaseBuffer(ItemPointerGetBlockNumber(&rtup->t_ctid));
/*
* invalidating system relations confuses the function cache of
- * pg_operator and pg_opclass
+ * pg_operator and pg_opclass, bjm
*/
if (!IsSystemRelationName(pgcform->relname.data))
RelationInvalidateHeapTuple(rd, rtup);
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index cdc15c7e0c9..e4ebd01055e 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -7,7 +7,7 @@
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
@@ -129,7 +129,7 @@ IndexNext(IndexScan *node)
{
bool prev_matches = false;
int prev_index;
-
+
/* ----------------
* store the scanned tuple in the scan tuple slot of
* the scan state. Eventually we will only do this and not
@@ -142,10 +142,17 @@ IndexNext(IndexScan *node)
slot, /* slot to store in */
buffer, /* buffer associated with tuple */
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;
prev_index++)
{
+ scanstate->cstate.cs_ExprContext->ecxt_scantuple = slot;
if (ExecQual(nth(prev_index, node->indxqual),
scanstate->cstate.cs_ExprContext))
{