Cope with more than 64K phrases in a thesaurus dictionary.
Cope with more than 64K phrases in a thesaurus dictionary.

dict_thesaurus stored phrase IDs in uint16 fields, so it would get confused
and even crash if there were more than 64K entries in the configuration
file.  It turns out to be basically free to widen the phrase IDs to uint32,
so let's just do so.

This was complained of some time ago by David Boutin (in bug #7793);
he later submitted an informal patch but it was never acted on.
We now have another complaint (bug #11901 from Luc Ouellette) so it's
time to make something happen.

This is basically Boutin's patch, but for future-proofing I also added a
defense against too many words per phrase.  Note that we don't need any
explicit defense against overflow of the uint32 counters, since before that
happens we'd hit array allocation sizes that repalloc rejects.

Back-patch to all supported branches because of the crash risk.

Postgres-XL/Postgres-XL,ashwinstar/gpdb,ovr/postgres-xl,lisakowen/gpdb,adam8157/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,techdragon/Postgres-XL,50wu/gpdb,adam8157/gpdb,zeroae/postgres-xl,50wu/gpdb,Postgres-XL/Postgres-XL,pavanvd/postgres-xl,zeroae/postgres-xl,50wu/gpdb,yazun/postgres-xl,adam8157/gpdb,xinzweb/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,Postgres-XL/Postgres-XL,techdragon/Postgres-XL,jmcatamney/gpdb,zeroae/postgres-xl,lisakowen/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,adam8157/gpdb,xinzweb/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,lisakowen/gpdb,50wu/gpdb,zeroae/postgres-xl,yazun/postgres-xl,zeroae/postgres-xl,ashwinstar/gpdb,lisakowen/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,adam8157/gpdb,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ovr/postgres-xl,50wu/gpdb,lisakowen/gpdb,ashwinstar/gpdb,adam8157/gpdb,jmcatamney/gpdb,yazun/postgres-xl,yazun/postgres-xl,greenplum-db/gpdb,ovr/postgres-xl,ovr/postgres-xl,pavanvd/postgres-xl,50wu/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,yazun/postgres-xl,50wu/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,oberstet/postgres-xl,techdragon/Postgres-XL,pavanvd/postgres-xl,oberstet/postgres-xl,ovr/postgres-xl,greenplum-db/gpdb,lisakowen/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,techdragon/Postgres-XL,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,adam8157/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,xinzweb/gpdb