Bugs item #2893484, was opened at 2009-11-06 19:06 Message generated for change (Settings changed) made by nielsnes 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: Closed >Resolution: Fixed 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 ---------------------------------------------------------------------- >Comment By: Niels Nes (nielsnes) Date: 2009-11-11 17:12 Message: added test to src/BugTracker-2009/case_evaluates_all_branches.SF-2893484.sql Fixed by rel_case_fixup optimizer ---------------------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/monetdb-bugs
