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 146f28272b92aeafea4c34923ac33860b2cb6d86..5d4a12c34e6c238b8bb341da42a05d66702728d9 100644 (file)
@@ -2041,6 +2041,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
                                                ExecStoreTuple(&newtup, slot, InvalidBuffer, false);
                                                ExecInsertIndexTuples(slot, &(newtup.t_self),
                                                                                          estate, true);
+                                               ResetPerTupleExprContext(estate);
                                        }
 
                                        WriteBuffer(cur_buffer);
@@ -2174,6 +2175,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
                        {
                                ExecStoreTuple(&newtup, slot, InvalidBuffer, false);
                                ExecInsertIndexTuples(slot, &(newtup.t_self), estate, true);
+                               ResetPerTupleExprContext(estate);
                        }
                }                                               /* walk along page */