Fix broken list-slinging logic in func_select_candidate and agg_select_candidate, which could cause them to keep more candidates than they should and thus fail to select a single match.  I had previously fixed the identical bug in oper_select_candidate, but didn't realize that the same error was repeated over here. Also, repair func_select_candidate's curious notion that it could scribble on the input type-OID vector.  That was causing failure to apply necessary type coercion later on, leading to malfunction of examples such as select date('now').
Fix broken list-slinging logic in func_select_candidate and
agg_select_candidate, which could cause them to keep more candidates
than they should and thus fail to select a single match.  I had
previously fixed the identical bug in oper_select_candidate, but
didn't realize that the same error was repeated over here.
Also, repair func_select_candidate's curious notion that it could
scribble on the input type-OID vector.  That was causing failure to
apply necessary type coercion later on, leading to malfunction of
examples such as select date('now').

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