Bugs item #2523442, was opened at 2009-01-20 11:50
Message generated for change (Comment added) made by nielsnes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2523442&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: SQL "stable"
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Jens Oehlschlägel (jens_oehl)
Assigned to: Niels Nes (nielsnes)
Summary: IS NULL handled wrong in searched CASE

Initial Comment:
SQL: IS NULL is accepted silently but handled wrong in searched CASE 
expression, see the following example

CREATE TABLE "sometable" (
  "somecol" INTEGER
)
;
INSERT INTO "sometable" VALUES ( 0);
INSERT INTO "sometable" VALUES ( 1);
INSERT INTO sometable VALUES (NULL);
COMMIT;

SELECT somecol
, CASE
  WHEN somecol < 6 THEN 'small'
  WHEN somecol = 6 THEN 'six'
  WHEN somecol > 6 AND somecol < 9 THEN '78'
  WHEN somecol IS NULL THEN 'NULL FOUND'
  ELSE 'big'
  END AS "NewColumnName"
FROM sometable
;
-- In WHEN "somecol IS NULL" is not evaluted to TRUE and the THEN expression 
returned, instead NULL is returned
-- workaround with COALESCE does NOT help


----------------------------------------------------------------------

>Comment By: Niels Nes (nielsnes)
Date: 2009-02-11 19:53

Message:
        The case condition column needs its null's removed.


----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2009-02-04 00:18

Message:
added test in Feb2009 release branch as
sql/src/test/BugTracker-2009/Tests/IS_NULL_in_CASE.*

behaves as reported in all three releases, Jun2008, Nov2008, Feb2009.


----------------------------------------------------------------------

Comment By: Jens Oehlschlägel (jens_oehl)
Date: 2009-01-20 11:56

Message:
Works for me if the IS NULL is the first WHEN statement, sorry

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2523442&group_id=56967

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to