Possible bug in CASE evaluation

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Possible bug in CASE evaluation
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17BB4EF8@ntex2010a.host.magwien.gv.at
обсуждение исходный текст
Ответы Re: Possible bug in CASE evaluation  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
I want to draw attention to this thread on -general:
CAMQ5dGq4SuJPbhT2-9XLAPAsvKNUL2-bb0cPyci2Fp+pfSfc3g@mail.gmail.com

Would you concur that this is a bug?

The fine manual says about CASE:
 If the condition's result is true, the value of the CASE expression is the result that follows the condition, and the
remainderof the CASE expression is not processed.
 

But:

test=> CREATE FUNCTION zero() RETURNS integer IMMUTABLE LANGUAGE SQL AS 'SELECT 0';
CREATE FUNCTION
test=> SELECT CASE WHEN (SELECT zero()) = 0 THEN -1 ELSE 1/zero() END;
ERROR:  division by zero

Yours,
Laurenz Albe

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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: Frontend/backend protocol improvements proposal (request).
Следующее
От: KONDO Mitsumasa
Дата:
Сообщение: Re: Improvement of checkpoint IO scheduler for stable transaction responses