Fix a gradual memory leak in ExecReScanAgg(). Because the aggregation hash table is allocated in a child context of the agg node's memory context, MemoryContextReset() will reset but *not* delete the child context. Since ExecReScanAgg() proceeds to build a new hash table from scratch (in a new sub-context), this results in leaking the header for the previous memory context. Therefore, use MemoryContextResetAndDeleteChildren() instead.
Fix a gradual memory leak in ExecReScanAgg(). Because the aggregation
hash table is allocated in a child context of the agg node's memory
context, MemoryContextReset() will reset but *not* delete the child
context. Since ExecReScanAgg() proceeds to build a new hash table
from scratch (in a new sub-context), this results in leaking the
header for the previous memory context. Therefore, use
MemoryContextResetAndDeleteChildren() instead.

Credit: My colleague Sailesh Krishnamurthy at Truviso for isolating
the cause of the leak.

xuegang/gpdb,arcivanov/postgres-xl,Chibin/gpdb,CraigHarris/gpdb,xinzweb/gpdb,jmcatamney/gpdb,ahachete/gpdb,zaksoup/gpdb,kaknikhil/gpdb,tpostgres-projects/tPostgres,chrishajas/gpdb,cjcjameson/gpdb,royc1/gpdb,oberstet/postgres-xl,janebeckman/gpdb,edespino/gpdb,ovr/postgres-xl,zeroae/postgres-xl,oberstet/postgres-xl,Quikling/gpdb,yazun/postgres-xl,janebeckman/gpdb,kmjungersen/PostgresXL,rvs/gpdb,jmcatamney/gpdb,janebeckman/gpdb,kaknikhil/gpdb,snaga/postgres-xl,lisakowen/gpdb,tpostgres-projects/tPostgres,royc1/gpdb,ovr/postgres-xl,postmind-net/postgres-xl,jmcatamney/gpdb,pavanvd/postgres-xl,ahachete/gpdb,arcivanov/postgres-xl,Chibin/gpdb,Quikling/gpdb,lisakowen/gpdb,cjcjameson/gpdb,rvs/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,Quikling/gpdb,jmcatamney/gpdb,royc1/gpdb,techdragon/Postgres-XL,tpostgres-projects/tPostgres,adam8157/gpdb,Chibin/gpdb,lintzc/gpdb,yuanzhao/gpdb,janebeckman/gpdb,yuanzhao/gpdb,ovr/postgres-xl,0x0FFF/gpdb,yuanzhao/gpdb,janebeckman/gpdb,snaga/postgres-xl,lintzc/gpdb,edespino/gpdb,pavanvd/postgres-xl,zaksoup/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,xinzweb/gpdb,kaknikhil/gpdb,CraigHarris/gpdb,Quikling/gpdb,lisakowen/gpdb,pavanvd/postgres-xl,xuegang/gpdb,janebeckman/gpdb,Chibin/gpdb,greenplum-db/gpdb,rvs/gpdb,adam8157/gpdb,adam8157/gpdb,xinzweb/gpdb,snaga/postgres-xl,50wu/gpdb,ahachete/gpdb,ashwinstar/gpdb,yazun/postgres-xl,jmcatamney/gpdb,kmjungersen/PostgresXL,rvs/gpdb,Quikling/gpdb,50wu/gpdb,xinzweb/gpdb,janebeckman/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,kmjungersen/PostgresXL,0x0FFF/gpdb,Chibin/gpdb,edespino/gpdb,chrishajas/gpdb,techdragon/Postgres-XL,yuanzhao/gpdb,tpostgres-projects/tPostgres,ahachete/gpdb,ahachete/gpdb,Postgres-XL/Postgres-XL,Quikling/gpdb,ovr/postgres-xl,Quikling/gpdb,adam8157/gpdb,edespino/gpdb,janebeckman/gpdb,edespino/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,lisakowen/gpdb,50wu/gpdb,yazun/postgres-xl,ashwinstar/gpdb,zaksoup/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,Postgres-XL/Postgres-XL,xuegang/gpdb,0x0FFF/gpdb,rvs/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,lintzc/gpdb,CraigHarris/gpdb,edespino/gpdb,xuegang/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,snaga/postgres-xl,snaga/postgres-xl,jmcatamney/gpdb,rvs/gpdb,pavanvd/postgres-xl,ahachete/gpdb,Quikling/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,Chibin/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,xinzweb/gpdb,cjcjameson/gpdb,edespino/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,Quikling/gpdb,zeroae/postgres-xl,chrishajas/gpdb,CraigHarris/gpdb,xuegang/gpdb,ovr/postgres-xl,CraigHarris/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,Chibin/gpdb,kaknikhil/gpdb,Postgres-XL/Postgres-XL,oberstet/postgres-xl,cjcjameson/gpdb,adam8157/gpdb,tpostgres-projects/tPostgres,zeroae/postgres-xl,yazun/postgres-xl,royc1/gpdb,ashwinstar/gpdb,CraigHarris/gpdb,adam8157/gpdb,Chibin/gpdb,zeroae/postgres-xl,50wu/gpdb,yuanzhao/gpdb,50wu/gpdb,ashwinstar/gpdb,50wu/gpdb,rvs/gpdb,zaksoup/gpdb,Postgres-XL/Postgres-XL,royc1/gpdb,xuegang/gpdb,kaknikhil/gpdb,rvs/gpdb,lintzc/gpdb,Chibin/gpdb,postmind-net/postgres-xl,Postgres-XL/Postgres-XL,xuegang/gpdb,royc1/gpdb,edespino/gpdb,Chibin/gpdb,lintzc/gpdb,lisakowen/gpdb,kaknikhil/gpdb,50wu/gpdb,zaksoup/gpdb,0x0FFF/gpdb,edespino/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,lintzc/gpdb,0x0FFF/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,ahachete/gpdb,CraigHarris/gpdb,royc1/gpdb,lisakowen/gpdb,xinzweb/gpdb,CraigHarris/gpdb,ahachete/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,arcivanov/postgres-xl,cjcjameson/gpdb,yuanzhao/gpdb,yazun/postgres-xl,rvs/gpdb,adam8157/gpdb,lisakowen/gpdb,chrishajas/gpdb,postmind-net/postgres-xl,xuegang/gpdb,postmind-net/postgres-xl,janebeckman/gpdb,lintzc/gpdb,jmcatamney/gpdb,edespino/gpdb,zaksoup/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,50wu/gpdb,0x0FFF/gpdb,zeroae/postgres-xl,xinzweb/gpdb,adam8157/gpdb,arcivanov/postgres-xl,Quikling/gpdb,xuegang/gpdb,cjcjameson/gpdb,chrishajas/gpdb,lintzc/gpdb,rvs/gpdb,chrishajas/gpdb,zaksoup/gpdb,chrishajas/gpdb,lintzc/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,zaksoup/gpdb,kaknikhil/gpdb,royc1/gpdb,cjcjameson/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,chrishajas/gpdb,postmind-net/postgres-xl