Re: crypt function crash on postgresql 9.3.20 and 10
От | David G. Johnston |
---|---|
Тема | Re: crypt function crash on postgresql 9.3.20 and 10 |
Дата | |
Msg-id | CAKFQuwbrY47BaU6-ERwsGr8btxwY4m2ubAB43nzCB2XT9k9qkg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: crypt function crash on postgresql 9.3.20 and 10 (Rainer Pruy <Rainer.Pruy@acrys.com>) |
Ответы |
Re: crypt function crash on postgresql 9.3.20 and 10
|
Список | pgsql-bugs |
On 02.02.2018 15:58, Михаил Манерко wrote:02.02.2018 17:55, David G. Johnston пишет:On Feb 2, 2018 8:15 PM, "Mike Porter" <mike@udel.edu> wrote:On Fri, 2 Feb 2018, Михаил Манерко wrote:If you send an asterisk in the crypt function, the function crashes.
example
i=# select crypt('123','*');
ОШИБКА: invalid salt
i=#function takes the text parameter
Should it fall from a 1-character long text?
Yes, exactly!
This is similar to calling "sqrt(-1)". The parameter is invalid for the function, such thatthe function can not be performed.
Right.
Functions generally (rarely, never) have domain types created for them that would prevent invalid input values from even being created. Defining constraints on input values is usually left up to the documentation. In this case the documentation describes how to properly use the function. Used properly a single-character long text string should never be input into the function - so it wasn't deemed necessary to document that if one supplies such a string incorrectly that the function will error out. That seems like a reasonable decision (intentional or otherwise).
David J.
В списке pgsql-bugs по дате отправления: