While I was running some tests in psql, trying to figure out how to change the query string to handle any length, I discovered that under certain conditions, psql will core dump when handling long strings.  Thus, the patch.  It was caused by a buffer overrun, probably not noticeable in a lot of cases, but pretty noticeable in mine.
While I was running some tests in psql, trying to figure out how to change
the query string to handle any length, I discovered that under certain
conditions, psql will core dump when handling long strings.  Thus, the
patch.  It was caused by a buffer overrun, probably not noticeable in a lot
of cases, but pretty noticeable in mine.

Problem was caused by the fact that the length check is only performed after
the check for a ; to get the end of the query and execute.

Cheers...

MikeA

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