Ensure that maxlen is an integer value in dict_int configuration

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Ensure that maxlen is an integer value in dict_int configuration
Дата
Msg-id F39EB4FB-62A7-4F01-93A8-0570CC485F4B@yesql.se
обсуждение исходный текст
Ответы Re: Ensure that maxlen is an integer value in dict_int configuration  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
Список pgsql-hackers
I recently had a usecase for dict_int, typoed my script and spent longer than
I’d like to admit finding said typo.  The attached patch scratches my itch by
ensuring that the maxlen parameter to dict_int is integer, instead of silently
setting it to zero on malformed input. Instead of this:

dg=# alter text search dictionary intdict (maxlen = a, rejectlong = true);
ALTER TEXT SEARCH DICTIONARY
dg=# select ts_lexize('intdict', '12345678');
 ts_lexize
-----------
 {}
(1 row)

.. the attached will error out with “ERROR: maxlen is out of range, must
be integer”, and be more in line with how we handle DefElem values.  A quick
grep around the tree didn’t turn up any other defelems doing this so I think
this is the only callsite.

cheers ./daniel


Вложения

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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: [HACKERS] GUC for cleanup indexes threshold.
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Parallel safety of binary_upgrade_create_empty_extension