build_subquery_pathkeys() was examining wrong copy of subquery target list, causing it to fail to recognize the output ordering of subqueries that contain set operations (UNION/INTERSECT/EXPECT).  Per example from Karel Zak.
build_subquery_pathkeys() was examining wrong copy of subquery target list,
causing it to fail to recognize the output ordering of subqueries that
contain set operations (UNION/INTERSECT/EXPECT).  Per example from Karel Zak.

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