Avoid memory leakage during VACUUM FULL when an index expression or
authorTom Lane <[email protected]>
Thu, 23 Dec 2004 22:42:32 +0000 (22:42 +0000)
committerTom Lane <[email protected]>
Thu, 23 Dec 2004 22:42:32 +0000 (22:42 +0000)
index predicate uses temporary memory for evaluation.  Per example
from Jean-Gerard Pailloncy.

src/backend/commands/vacuum.c

index bcf9b6e2e5f489b9dc4cc88bbd84d18b52430923..b9cf439635aab7312a29eb9cec6200d9559aedc9 100644 (file)
@@ -2553,6 +2553,7 @@ move_chain_tuple(Relation rel,
        {
                ExecStoreTuple(&newtup, ec->slot, InvalidBuffer, false);
                ExecInsertIndexTuples(ec->slot, &(newtup.t_self), ec->estate, true);
+               ResetPerTupleExprContext(ec->estate);
        }
 }
 
@@ -2662,6 +2663,7 @@ move_plain_tuple(Relation rel,
        {
                ExecStoreTuple(&newtup, ec->slot, InvalidBuffer, false);
                ExecInsertIndexTuples(ec->slot, &(newtup.t_self), ec->estate, true);
+               ResetPerTupleExprContext(ec->estate);
        }
 }