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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Cope with more than 64K phrases in a thesaurus dictionary.
Дата
Msg-id E1XmYkB-0005Fi-Iz@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d6e37b35cda9a88dfd938dd61e9986dd93cc6dd3

Modified Files
--------------
src/backend/tsearch/dict_thesaurus.c |   25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Cope with more than 64K phrases in a thesaurus dictionary.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Cope with more than 64K phrases in a thesaurus dictionary.