Fix ts_stat's failure on empty tsvector. Also insert a couple of Asserts that check for stack overflow. Bogus coding appears to be new in 8.4 --- older releases had a much simpler algorithm here.  Per bug #5111.
Fix ts_stat's failure on empty tsvector.
Also insert a couple of Asserts that check for stack overflow.
Bogus coding appears to be new in 8.4 --- older releases had a much
simpler algorithm here.  Per bug #5111.

tpostgres-projects/tPostgres,xinzweb/gpdb,kmjungersen/PostgresXL,zeroae/postgres-xl,xinzweb/gpdb,postmind-net/postgres-xl,ashwinstar/gpdb,pavanvd/postgres-xl,yazun/postgres-xl,adam8157/gpdb,snaga/postgres-xl,techdragon/Postgres-XL,yazun/postgres-xl,greenplum-db/gpdb,ovr/postgres-xl,yazun/postgres-xl,50wu/gpdb,zeroae/postgres-xl,xinzweb/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,arcivanov/postgres-xl,arcivanov/postgres-xl,adam8157/gpdb,adam8157/gpdb,adam8157/gpdb,oberstet/postgres-xl,50wu/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,ashwinstar/gpdb,50wu/gpdb,ovr/postgres-xl,oberstet/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,Postgres-XL/Postgres-XL,lisakowen/gpdb,techdragon/Postgres-XL,ovr/postgres-xl,tpostgres-projects/tPostgres,lisakowen/gpdb,jmcatamney/gpdb,lisakowen/gpdb,snaga/postgres-xl,greenplum-db/gpdb,50wu/gpdb,arcivanov/postgres-xl,pavanvd/postgres-xl,jmcatamney/gpdb,greenplum-db/gpdb,postmind-net/postgres-xl,Postgres-XL/Postgres-XL,greenplum-db/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,lisakowen/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,pavanvd/postgres-xl,adam8157/gpdb,kmjungersen/PostgresXL,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,tpostgres-projects/tPostgres,arcivanov/postgres-xl,zeroae/postgres-xl,techdragon/Postgres-XL,arcivanov/postgres-xl,jmcatamney/gpdb,lisakowen/gpdb,tpostgres-projects/tPostgres,snaga/postgres-xl,50wu/gpdb,kmjungersen/PostgresXL,greenplum-db/gpdb,zeroae/postgres-xl,snaga/postgres-xl,ovr/postgres-xl,jmcatamney/gpdb,postmind-net/postgres-xl,jmcatamney/gpdb,ashwinstar/gpdb,lisakowen/gpdb,zeroae/postgres-xl,techdragon/Postgres-XL,adam8157/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,postmind-net/postgres-xl,kmjungersen/PostgresXL,oberstet/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,tpostgres-projects/tPostgres,xinzweb/gpdb,pavanvd/postgres-xl,snaga/postgres-xl,lisakowen/gpdb,lisakowen/gpdb,yazun/postgres-xl,techdragon/Postgres-XL,50wu/gpdb,ovr/postgres-xl,50wu/gpdb,xinzweb/gpdb,50wu/gpdb,postmind-net/postgres-xl,ashwinstar/gpdb