pull_up_subqueries() should copy the subquery before starting to modify it.  Not sure why I'd thought it would be a good idea to do differently way back when, but Greg Stark exposed the folly of doing so ...
pull_up_subqueries() should copy the subquery before starting to modify
it.  Not sure why I'd thought it would be a good idea to do differently
way back when, but Greg Stark exposed the folly of doing so ...

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