Bugs item #2853458, was opened at 2009-09-07 12:03
Message generated for change (Comment added) made by stmane
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2853458&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 CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stefan de Konink (skinkie)
Assigned to: Niels Nes (nielsnes)
Summary: SQL: cast exceeding maximum value, returns null

Initial Comment:
Should this be prevented? Or is a cast a cast?

>select cast(power(2,63) as bigint);
+----------------------+
| power_single_value   |
+======================+
|                 null |
+----------------------+
1 tuple
sql>select power(2,63);
+------------------------+
| power_single_value     |
+========================+
| 9.2233720368547758e+18 |
+------------------------+
1 tuple


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

>Comment By: Stefan Manegold (stmane)
Date: 2009-09-08 11:41

Message:
The div_by_zero is probably not related "code-wise", but possibly
"conceptually":
Errors like division by zero (in batcalc.mx) or overflows (with arthmetics
in batcalc.mx or casts in batcast.mx) are partly reported as errors, partly
handled by resulting in nil/null, partly simply ignored.
For an efficient SQL implementation/support, we'd probably at least need
two variants of each "bulk" ("multiplex") aritmetic and cast operation in
batcalc.mx and batcast.mx: one that "silently" turns errors and overflows
into nil/null, and one the raises an error/exception.
The SQL compiler then needs to decide which semantics it requires and call
the respective primitive ...


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

Comment By: Fabian (mr-meltdown)
Date: 2009-09-08 11:14

Message:
div_by_zero.SF-987304 no longer returns an error but returns NULL instead,
can that be related to this bug?

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

Comment By: Niels Nes (nielsnes)
Date: 2009-09-07 22:58

Message:
sql should give an error (ie overflow)

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2853458&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

Reply via email to