[ monetdb-Bugs-2893484 ] All CASE branches are evaluated

View: New views
1 Messages — Rating Filter:   Alert me  

[ monetdb-Bugs-2893484 ] All CASE branches are evaluated

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bugs item #2893484, was opened at 2009-11-06 14:06
Message generated for change (Tracker Item Submitted) made by smokinn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2893484&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: MonetDB5 "stable"
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Guillaume Theoret (smokinn)
Assigned to: Niels Nes (nielsnes)
Summary: All CASE branches are evaluated

Initial Comment:
MonetDB seems to evaluate both branches of a CASE regardless of whether the branch will be taken or not:

sql>SELECT
more>CASE SUM(payout_units_cpc)
more>WHEN 0 THEN 0
more>ELSE 1
more>END AS avg_cost_cpc
more>FROM daily.stats_2009_week_31;
SELECT
+--------------+
| avg_cost_cpc |
+==============+
|            0 |
+--------------+
1 tuple
Timer      27.990 msec 1 rows
sql>SELECT
more>CASE SUM(payout_units_cpc)
more>WHEN 0 THEN 0
more>ELSE cast(SUM(payout_units_cpc * payout_cpc) as numeric(12,4)) / SUM(payout_units_cpc)
more>END AS avg_cost_cpc
more>FROM daily.stats_2009_week_31;
!MALException:calc./:Illegal argument Division by zero
0 tuples
Timer      16.415 msec 0 rows


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

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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-bugs mailing list
Monetdb-bugs@...
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs