aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-11-19 20:58:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-11-19 20:58:42 +0000
commitefd2ae8f19c874137c209f7a3b549d47edb387c0 (patch)
tree45b6e3683a1c219b061f33a34e894f21824e5793 /src
parentdccfa4d3f2f9716632ad946a1582bff3be9e70f0 (diff)
downloadpostgresql-efd2ae8f19c874137c209f7a3b549d47edb387c0.tar.gz
postgresql-efd2ae8f19c874137c209f7a3b549d47edb387c0.zip
Stopgap solution for problem reported by Alexey Beschiokov: after
doing heap_insert or heap_update, wipe out any extracted fields in the TupleTableSlot containing the tuple, because they might not be valid anymore if tuptoaster.c changed the tuple. Safe because slot must be in the materialized state, but mighty ugly --- find a better answer!
Diffstat (limited to 'src')
-rw-r--r--src/backend/executor/execMain.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 48efdeb59e5..4e828e82953 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.256.2.1 2005/11/14 17:43:12 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.256.2.2 2005/11/19 20:58:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1446,6 +1446,16 @@ ExecInsert(TupleTableSlot *slot,
setLastTid(&(tuple->t_self));
/*
+ * KLUGE SOLUTION for bug found post 8.1 release: if the tuple toaster
+ * fired on the tuple then it changed the physical tuple inside the
+ * tuple slot, leaving any extracted information invalid. Mark the
+ * extracted state invalid just in case. Need to fix things so that
+ * the toaster gets to run against the tuple before we materialize it,
+ * but that's way too invasive for a stable branch.
+ */
+ slot->tts_nvalid = 0;
+
+ /*
* insert index entries for tuple
*/
if (resultRelInfo->ri_NumIndices > 0)
@@ -1700,6 +1710,16 @@ lreplace:;
(estate->es_processed)++;
/*
+ * KLUGE SOLUTION for bug found post 8.1 release: if the tuple toaster
+ * fired on the tuple then it changed the physical tuple inside the
+ * tuple slot, leaving any extracted information invalid. Mark the
+ * extracted state invalid just in case. Need to fix things so that
+ * the toaster gets to run against the tuple before we materialize it,
+ * but that's way too invasive for a stable branch.
+ */
+ slot->tts_nvalid = 0;
+
+ /*
* Note: instead of having to update the old index tuples associated with
* the heap tuple, all we do is form and insert new index tuples. This is
* because UPDATEs are actually DELETEs and INSERTs, and index tuple