1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +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:
Tom Lane
2005-11-20 18:38:20 +00:00
parent 33a9af738d
commit 40314f2dac
4 changed files with 125 additions and 102 deletions

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.23 2005/07/06 19:02:53 momjian Exp $
* $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.24 2005/11/20 18:38:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -66,19 +66,21 @@
/* ----------
* heap_tuple_toast_attrs() -
* toast_insert_or_update -
*
* Called by heap_insert(), heap_update() and heap_delete().
* Outdates any no-longer-needed toast entries referenced
* by oldtup and creates new ones until newtup is no more than
* TOAST_TUPLE_TARGET (or we run out of toastable values).
* Possibly modifies newtup by replacing the t_data part!
*
* oldtup is NULL if insert, newtup is NULL if delete.
* Called by heap_insert() and heap_update().
* ----------
*/
extern void heap_tuple_toast_attrs(Relation rel,
HeapTuple newtup, HeapTuple oldtup);
extern HeapTuple toast_insert_or_update(Relation rel,
HeapTuple newtup, HeapTuple oldtup);
/* ----------
* toast_delete -
*
* Called by heap_delete().
* ----------
*/
extern void toast_delete(Relation rel, HeapTuple oldtup);
/* ----------
* heap_tuple_fetch_attr() -