postgresql/src/backend/tsearch
Tom Lane cf1c65070a Limit to_tsvector_byid's initial array allocation to something sane.
The initial estimate of the number of distinct ParsedWords is just
that: an estimate.  Don't let it exceed what palloc is willing to
allocate.  If in fact we need more entries, we'll eventually fail
trying to enlarge the array.  But if we don't, this allows success on
inputs that currently draw "invalid memory alloc request size".

Per bug #18080 from Uwe Binder.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/18080-d5c5e58fef8c99b7@postgresql.org
2023-09-25 11:50:28 -04:00
..
dicts Update copyright for 2019 2019-01-02 12:44:25 -05:00
Makefile Update copyright for 2023 2023-01-02 15:00:37 -05:00
dict.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
dict_ispell.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
dict_simple.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
dict_synonym.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
dict_thesaurus.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
regis.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
spell.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
to_tsany.c Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
ts_locale.c Fix t_isspace(), etc., when datlocprovider=i and datctype=C. 2023-03-17 12:08:46 -07:00
ts_parse.c Remove stray mid-sentence tabs in comments 2023-05-19 16:13:16 +02:00
ts_selfuncs.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
ts_typanalyze.c Take pg_attribute out of VacAttrStats 2023-07-03 07:18:57 +02:00
ts_utils.c Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
wparser.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
wparser_def.c Check for interrupts and stack overflow in TParserGet(). 2023-06-24 17:18:08 -04:00