postgresql/src
Tom Lane 39493e4d92 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.
2014-11-06 20:53:07 -05:00
..
backend Cope with more than 64K phrases in a thesaurus dictionary. 2014-11-06 20:53:07 -05:00
bin Fix core dump in pg_dump --binary-upgrade on zero-column composite type. 2014-10-17 12:49:15 -04:00
include Test IsInTransactionChain, not IsTransactionBlock, in vac_update_relstats. 2014-10-30 13:03:39 -04:00
interfaces Reset error message at PQreset() 2014-10-29 14:35:39 +02:00
makefiles Don't use deprecated dllwrap on Cygwin. 2014-02-01 16:14:15 -05:00
pl Translation updates 2014-07-21 00:56:23 -04:00
port Suppress dead, unportable src/port/crypt.c code. 2014-10-12 23:27:36 -04:00
template Don't try to force use of -no-cpp-precomp on OS X. It's been five years 2010-08-02 04:51:25 +00:00
test Avoid corrupting tables when ANALYZE inside a transaction is rolled back. 2014-10-29 18:12:20 -04:00
timezone Support timezone abbreviations that sometimes change. 2014-10-16 15:22:26 -04:00
tools MSVC: Substitute $(top_builddir) in REGRESS_OPTS. 2014-07-23 00:36:34 -04:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:25 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Rethink the way walreceiver is linked into the backend. Instead than shoving 2010-01-20 09:16:24 +00:00
Makefile.global.in Add mode where contrib installcheck runs each module in a separately named database. 2012-12-11 11:48:00 -05:00
Makefile.shlib fix whitespace 2014-02-01 16:26:31 -05:00
nls-global.mk Avoid error from mkdir if no languages are to be installed 2010-05-13 14:35:28 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00