    Fix up JOIN .. USING with domains
    Fix up JOIN .. USING with domains

The attached fixes select_common_type() to support the below case:

create table t1( c1 int);
create domain dom_c1 int;
create table t2(c1 dom_c1);
select * from t1 join t2 using( c1 );

I didn't see a need for maintaining the domain as the preferred type. A
simple getBaseType() call on all elements of the list seems to be
enough.

--
Rod Taylor <rbt@rbt.ca>

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