BUG #1406: subsequent WHEN/ELSE is getting validated, eventhough prior WHEN condition is true

Поиск
Список
Период
Сортировка
От manikanti sreedhar reddy
Тема BUG #1406: subsequent WHEN/ELSE is getting validated, eventhough prior WHEN condition is true
Дата
Msg-id 200501170927.j0H9RRFT032239@developer.pgadmin.org
обсуждение исходный текст
Ответы Re: BUG #1406: subsequent WHEN/ELSE is getting  (Manikanti Sreedhar Reddy <manikant@intoto.com>)
Re: BUG #1406: subsequent WHEN/ELSE is getting validated, eventhough prior WHEN condition is true  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      1406
Logged by:          manikanti sreedhar reddy
Email address:      manikant@intoto.com
PostgreSQL version: 7.4.2
Operating system:   Windows
Description:        subsequent WHEN/ELSE is getting validated, eventhough
prior WHEN condition is true
Details:

Subsequent WHEN/ELSE is getting validated, eventhough prior WHEN condition
is true.

Let us take an example:

select (CASE WHEN POSITION('/' IN '172.16.1.1-172.16.1.25')=0 THEN FALSE
ELSE (INET('172.16.1.1-172.16.1.25'::INET) >>  INET('internalnetwork'::INET)
) END);

In this, example since the first when condition is always true (since / is
not present in '172.16.1.1-172.16.1.25' and POSITION('/' IN
'172.16.1.1-172.16.1.25')=0 always evaluated to true) the expected output is
false.  Whereas postgresql is evaluating the INET('intervalnetwork'::INET)
expression which is in ELSE case, which is not supposed to happen!

Thanks,

-Sreedhar Reddy

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: BUG #1393: Adding 'LIMIT 1' to the query halts forever
Следующее
От: Manikanti Sreedhar Reddy
Дата:
Сообщение: Re: BUG #1406: subsequent WHEN/ELSE is getting