Fix calculation of plan node extParams to account for the possibility that one initPlan sets a parameter for another.  This could not (I think) happen before 8.1, but it's possible now because the initPlans generated by MIN/MAX optimization might themselves use initPlans.  We attach those initPlans as siblings of the MIN/MAX ones, not children, to avoid duplicate computation when multiple MIN/MAX aggregates are present; so this leads to the case of an initPlan needing the result of a sibling initPlan, which is not possible with ordinary query nesting.  Hadn't been noticed because in most contexts having too much stuff listed in extParam is fairly harmless.  Fixes "plan should not reference subplan's variable" bug reported by Catalin Pitis.
Fix calculation of plan node extParams to account for the possibility that one
initPlan sets a parameter for another.  This could not (I think) happen before
8.1, but it's possible now because the initPlans generated by MIN/MAX
optimization might themselves use initPlans.  We attach those initPlans as
siblings of the MIN/MAX ones, not children, to avoid duplicate computation
when multiple MIN/MAX aggregates are present; so this leads to the case of an
initPlan needing the result of a sibling initPlan, which is not possible with
ordinary query nesting.  Hadn't been noticed because in most contexts having
too much stuff listed in extParam is fairly harmless.  Fixes "plan should not
reference subplan's variable" bug reported by Catalin Pitis.

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