Hi,
Von: Jean-Christophe Deschamps
This would means that if ever an SQL statement encounters divide by
zero, the application will crash with no way handle the situation
gracefully, nor to locate the source of the problem.
Seriously, what are you talking about? Why is there no way
Hi, Dave,
Von: Dave Wellman
The problem deals with dividing by 0. As far as I can remember, in every
programming language that I have ever used and in all databases that I've
used, if you try and divide by 0 the process will fail with a 'divide by
zero' error. Sqlite doesn't seem to do
Dear forum,
MySQL does it too unless ERROR_FOR_DIVISION_BY_ZERO mode is enabled:
http://dev.mysql.com/doc/refman/5.0/en/arithmetic-functions.html
SQL Server does it too unless SET ARITHABORT is ON:
http://technet.microsoft.com/en-us/library/aa259212(v=sql.80).aspx
PostgreSQL doesn't do it,
Jean-Christophe Deschamps wrote:
There is another good reason why raising an exception would be
a terrible choice. When SQLite is used as a shared library by some
scripting language, there is /*no*/ possibility to trap exceptions
raised within the library.
What the SQL standard calls an
What the SQL standard calls an exception is not necessarily exactly
the same as an exception in other programming languages.
Granted.
If SQLite were to change the division-by-zero handling, it could be
reported exactly like most other errors, by returning SQLITE_ERROR from
sqlite3_step().
On Tue, 16 Sep 2014 01:42:11 +0100
Simon Slavin slav...@bigfraud.org wrote:
Whether or not something is an error is a matter of definition.
SQLite defines division by zero to be NULL. It's very unusual in
that regard.
MySQL does it too unless ERROR_FOR_DIVISION_BY_ZERO mode is enabled:
On Tue, 16 Sep 2014 08:59:31 +0200
Jean-Christophe Deschamps j...@antichoc.net wrote:
This would means that if ever an SQL statement encounters divide by
zero, the application will crash with no way handle the situation
gracefully, nor to locate the source of the problem.
Seriously, what
This would means that if ever an SQL statement encounters divide by
zero, the application will crash with no way handle the situation
gracefully, nor to locate the source of the problem.
Seriously, what are you talking about? Why is there no way to handle
the error, gracefully otherwise?
Hi all,
I've found that an sql request that I expected to fail, but it didn't. On
the face of it that is good news but there is a potential downside. I wonder
if my expectation is wrong or if this is a bug which so far hasn't been
caught.
The problem deals with dividing by 0. As far as I
On Mon, Sep 15, 2014 at 2:50 PM, Dave Wellman dwell...@ward-analytics.com
wrote:
The problem deals with dividing by 0. As far as I can remember, in every
programming language that I have ever used and in all databases that I've
used, if you try and divide by 0 the process will fail with a
On 15 Sep 2014, at 7:50pm, Dave Wellman dwell...@ward-analytics.com wrote:
Should trying to divide by 0 result in an error?
No. There's no mechanism for reporting a mathematical error in SQL. You can
report malformed commands, references to entities (tables, columns, etc.) which
don't
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Divide by 0 not giving error
On 15 Sep 2014, at 7:50pm, Dave Wellman dwell...@ward-analytics.com wrote:
Should trying to divide by 0 result in an error?
No. There's no mechanism for reporting a mathematical error in SQL. You
can
On 15 Sep 2014, at 8:33pm, Dave Wellman dwell...@ward-analytics.com wrote:
Simon,
I'm really surprised at that. Effectively what this means is that the answer
that Sqlite returns may or may not be the correct result.
What ? No. It's correct. The answer is not known, and NULL means I don't
On 2014/09/15 20:50, Dave Wellman wrote:
Hi all,
I've found that an sql request that I expected to fail, but it didn't. On
the face of it that is good news but there is a potential downside. I wonder
if my expectation is wrong or if this is a bug which so far hasn't been
caught.
The
On 2014/09/15 22:13, Simon Slavin wrote:
On 15 Sep 2014, at 8:33pm, Dave Wellman dwell...@ward-analytics.com wrote:
Simon,
I'm really surprised at that. Effectively what this means is that the answer
that Sqlite returns may or may not be the correct result.
What ? No. It's correct. The
On Mon, 15 Sep 2014 21:13:01 +0100
Simon Slavin slav...@bigfraud.org wrote:
I suppose we then get into a discussion of what is the 'correct
result'. I completely understand that NULL is unknown, but I've
always thought that there is a difference between unknown and
'error'.
It is not
On 16 Sep 2014, at 1:23am, James K. Lowden jklow...@schemamania.org wrote:
Whether or not something is an error is a matter of definition.
SQLite defines division by zero to be NULL. It's very unusual in that
regard.
MySQL does it too unless ERROR_FOR_DIVISION_BY_ZERO mode is enabled:
17 matches
Mail list logo