From: | Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
---|---|
To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Possible bug in CASE evaluation |
Date: | 2013-06-21 08:16:22 |
Message-ID: | A737B7A37273E048B164557ADEF4A58B17BB4EF8@ntex2010a.host.magwien.gv.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I want to draw attention to this thread on -general:
CAMQ5dGq4SuJPbhT2-9XLAPAsvKNUL2-bb0cPyci2Fp+pfSfc3g(at)mail(dot)gmail(dot)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 remainder of 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
From | Date | Subject | |
---|---|---|---|
Next Message | KONDO Mitsumasa | 2013-06-21 08:29:40 | Re: Improvement of checkpoint IO scheduler for stable transaction responses |
Previous Message | Albe Laurenz | 2013-06-21 07:39:40 | Re: Frontend/backend protocol improvements proposal (request). |