Bugs item #2791361, was opened at 2009-05-13 21:28
Message generated for change (Tracker Item Submitted) made by skinkie
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2791361&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 CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Niels Nes (nielsnes)
Summary: Division by zero error
Initial Comment:
In a simple example the following works:
create table test2 (bla1 double, bla2 double);
insert into test2 values (1,1);
insert into test2 values (1,2);
insert into test2 values (1,3);
select case when (bla1 - bla2) > 0 then 1/(bla1 - bla2) else 0 end from test2;
select case when (bla1 - bla2) > 0 then 1/(bla1 - bla2) else 0 end from test2;
+------------------------+
| isnull_>_sql_sub_bla1 |
+========================+
| 0 |
| 1 |
| 0.5 |
+------------------------+
3 tuples
According to Martin the following example creates a division by zero because
they are constants:
select case when (2 - 2) > 0 then (3 - 2)/(2 - 2) else 0 end as "test";
!MALException:calc./:Division by zero
Unlike in PostgreSQL where the output is 0; (Lazy evaluation)
Now in my original query:
select n1.lat, n1.long, n2.lat, n2.long, case when (n2.lat - n1.lat) > 0 then
(n2.long - n1.long)/(n2.lat - n1.lat) else 0 end from nodes_legacy as n1,
nodes_legacy as n2, segments where node1 = n1.id and node2 = n2.id limit 10;
Also returns division by zero.
But in this case: !ArithmeticException:batcalc./:Division by zero
CREATE TABLE "sys"."nodes_legacy" (
"id" int,
"long" double,
"lat" double,
"uid" int,
"timestamp" timestamptz(7)
);
CREATE TABLE "sys"."segments" (
"way" int,
"node1" int,
"node2" int
);
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2791361&group_id=56967
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs