Fix max(int8) result by making sure int8larger() copies its result  rather than reusing the input storage. Also made the same fix to int8smaller(), though there wasn't a symptom,  and went through and verified that other pass-by-reference data types  do the same thing. Not an issue for the by-value types.
Fix max(int8) result by making sure int8larger() copies its result
 rather than reusing the input storage.
Also made the same fix to int8smaller(), though there wasn't a symptom,
 and went through and verified that other pass-by-reference data types
 do the same thing. Not an issue for the by-value types.

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