On Tue, Mar 29, 2011 at 3:56 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Tue, Mar 29, 2011 at 4:48 AM, Max Vlasov <max.vla...@gmail.com> wrote:
>
> > Hi,
> >
> > I sometimes use repeated digits as test data, for example 123456789
> > repeated
> > multiply times and recently some of my complex queries where I
> occasionally
> > wrongly chose a field gave 'unknown error' in the middle of the process.
> > Tracking it led to sqlite3AtoF function that appears to be raising
> Floating
> > overflow exception (at least on windows) for some extremely large numbers
> >
> > The test showing the effect (tested with v3.7.5)
> >
> > CREATE TABLE [Temp] ([Value] TEXT)
> > INSERT INTO Temp (Value) VALUES ('1234567890...') //Totally 310 digits
> > SELECT Cast(Value As Float) FROM Temp
> >
> > the result of this query in my case is 'unknown error' and no data shown.
> >
>
> I cannot reproduce this problem.  My script is this:
>
> CREATE TABLE t1(v TEXT);
> INSERT INTO t1
>
> VALUES('1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
> SELECT length(v) FROM t1;
> SELECT CAST(v AS float) FROM t1;
>
> I ran this on Linux, Mac, and Windows and in all cases I got as output:
>
>
> 310
> Inf
>
> Which is pretty much what you would expect.  No floating-point exceptions
> or
> other anomalies.
>
>
Thanks, this forced me to search more on the topic. I use Delphi and it
appears that all Borland compilers has their own floating-point exception
handling chain and it is on by default so if any division by zero or
overflow appears inside sqlite3_step Delphi will handle this with its own
exception handling. More on this was here:
http://www.eztwain.com/borland-issue.htm

Probably I will need to suppress this chain manually or get ready to catch
it myself. But I suppose sqlite might not be ready for the latter and
probably won't free some resources. Hmm, or even worse, it might bypass some
important calls for query finalization. I should think what to do with this.


Thanks,

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

Reply via email to