Simon Slavin <slav...@bigfraud.org> wrote:
> On 6 Jun 2011, at 4:39am, Sidney Cadot wrote:
>> That's a bit of a philosophical point. In the context of SQLite, the
>> expression 1.0 / 0.0 evaluates to something that is representable,
>> namely NULL, that much is clear. Whether NULL is to be considered a
>> value is up for debate.
> 
> No, it's in the standard.  Unfortunately you have to pay to receive the 
> standards document, but in the draft standard at
> 
> http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt

If we talking about the standard, note that both division by zero and numeric 
overflow are supposed to trigger an error:

6.12-General Rules-4: If the value of a divisor is zero, then an exception 
condition is raised: data exception-division by zero.


6.12-General Rules-6: If the type of the result of an arithmetic operation is 
approximate numeric and the exponent of the approximate mathematical result of 
the operation is not within the implementation-defined exponent range for the 
result type, then an exception condition is raised: data exception-numeric 
value out of range.

3.3.4.1: The phrase "an exception condition is raised:", followed by the name 
of a condition, is used in General Rules and elsewhere to indicate that the 
execution of a statement is unsuccessful, application of General Rules, other 
than those of Subclause 12.3, "<procedure>", and Subclause 20.1, "<direct SQL 
statement>", may be terminated, diagnostic information is to be made available, 
and execution of the statement is to have no effect on SQL-data or schemas.


So SQLite behaves neither in the way expected by the OP, nor in the way 
prescribed by the standard (I'm not arguing that's a bad thing, just stating 
the fact).
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to