Tweak trivial_subqueryscan() to consider a SubqueryScan's targetlist trivial if it contains either Vars referencing the corresponding subplan columns, or Consts equaling the corresponding subplan columns.  This lets the planner eliminate the SubqueryScan in some cases generated by generate_setop_tlist().
Tweak trivial_subqueryscan() to consider a SubqueryScan's targetlist
trivial if it contains either Vars referencing the corresponding subplan
columns, or Consts equaling the corresponding subplan columns.  This
lets the planner eliminate the SubqueryScan in some cases generated by
generate_setop_tlist().

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