diff options
author | Jan Wieck <JanWieck@Yahoo.com> | 2000-07-21 11:18:51 +0000 |
---|---|---|
committer | Jan Wieck <JanWieck@Yahoo.com> | 2000-07-21 11:18:51 +0000 |
commit | 0143d391c637daa8ebea41bc2c7a1f97660d4246 (patch) | |
tree | 9c27a940f057db807cd92751d14c74d5f19697d3 | |
parent | 82f3945a671aca50f63e87f7395d5948a2489e7b (diff) | |
download | postgresql-0143d391c637daa8ebea41bc2c7a1f97660d4246.tar.gz postgresql-0143d391c637daa8ebea41bc2c7a1f97660d4246.zip |
Need to switch to tuples memory context when replacing the toasted
one with the plain one.
Jan
-rw-r--r-- | src/backend/access/heap/heapam.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 16d2ed470eb..08c9b87b79e 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.80 2000/07/21 10:31:30 wieck Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.81 2000/07/21 11:18:51 wieck Exp $ * * * INTERFACE ROUTINES @@ -1360,7 +1360,11 @@ heap_insert(Relation relation, HeapTuple tup) { if (tup->t_datamcxt != NULL && (char *) (tup->t_data) != ((char *) tup + HEAPTUPLESIZE)) + { + MemoryContext oldcxt = MemoryContextSwitchTo(tup->t_datamcxt); pfree(tup->t_data); + MemoryContextSwitchTo(oldcxt); + } tup->t_data = plaintdata; tup->t_len = plaintlen; } @@ -1672,7 +1676,11 @@ l2: { if (newtup->t_datamcxt != NULL && (char *) (newtup->t_data) != ((char *) newtup + HEAPTUPLESIZE)) + { + MemoryContext oldcxt = MemoryContextSwitchTo(newtup->t_datamcxt); pfree(newtup->t_data); + MemoryContextSwitchTo(oldcxt); + } newtup->t_data = plaintdata; newtup->t_len = plaintlen; } |