mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Modify tuptoaster's API so that it does not try to modify the passed
tuple in-place, but instead passes back an all-new tuple structure if any changes are needed. This is a much cleaner and more robust solution for the bug discovered by Alexey Beschiokov; accordingly, revert the quick hack I installed yesterday. With this change, HeapTupleData.t_datamcxt is no longer needed; will remove it in a separate commit in HEAD only.
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.259 2005/11/19 20:57:44 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.260 2005/11/20 18:38:20 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1445,16 +1445,6 @@ ExecInsert(TupleTableSlot *slot,
|
||||
estate->es_lastoid = newId;
|
||||
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
|
||||
*/
|
||||
@ -1709,16 +1699,6 @@ lreplace:;
|
||||
IncrReplaced();
|
||||
(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
|
||||
|
Reference in New Issue
Block a user