diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-22 00:50:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-22 00:50:07 +0000 |
commit | c9fe12831632efc437354cb0482fd6cb5f246a4a (patch) | |
tree | b9b19b88a07ebfd51915b60bc492bfe68c6cd732 /src/backend/commands/copy.c | |
parent | 59a3a401497cd72c550fdfcaa782162d91335bba (diff) | |
download | postgresql-c9fe12831632efc437354cb0482fd6cb5f246a4a.tar.gz postgresql-c9fe12831632efc437354cb0482fd6cb5f246a4a.zip |
Clean up per-tuple memory leaks in trigger firing and plpgsql
expression evaluation.
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index e26dac47ce6..82577b0426d 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.130 2001/01/19 06:54:57 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.131 2001/01/22 00:50:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -705,6 +705,9 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, lineno++; + /* Reset the per-output-tuple exprcontext */ + ResetPerTupleExprContext(estate); + /* Initialize all values for row to NULL */ MemSet(values, 0, attr_count * sizeof(Datum)); MemSet(nulls, 'n', attr_count * sizeof(char)); @@ -861,7 +864,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, { HeapTuple newtuple; - newtuple = ExecBRInsertTriggers(rel, tuple); + newtuple = ExecBRInsertTriggers(estate, rel, tuple); if (newtuple == NULL) /* "do nothing" */ skip_tuple = true; @@ -895,7 +898,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, /* AFTER ROW INSERT Triggers */ if (rel->trigdesc && rel->trigdesc->n_after_row[TRIGGER_EVENT_INSERT] > 0) - ExecARInsertTriggers(rel, tuple); + ExecARInsertTriggers(estate, rel, tuple); } for (i = 0; i < attr_count; i++) |