Here is a rebase after "pow" addition.

Huh, you are fast.

Investigating your patch I found that all arguments of logical AND/OR and CASE are always evaluated. Seems, it should not be for pair of reasons:
- computing of unneeded args could be too expensive
- computing of unneeded args could complicate scripting code, look:
\set zy 0
\set yz case when :zy = 0 then -1 else (1 / :zy) end
This example will fail although programmer tried to check forbidden value

case when 1>0 then 1 when 1/0 > 0 then 0 else -1 end --  fails too

SQL doesn't evaluate unneeded arguments:
select case when 1>0 then 33 when 1/0 > 0 then -33 else null end;
 case
------
   33

--
Teodor Sigaev                                   E-mail: teo...@sigaev.ru
                                                   WWW: http://www.sigaev.ru/

Reply via email to