Bugs item #2523442, was opened at 2009-01-20 12:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Open
Resolution: None
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


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

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

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to