Page 1 of 1

Invalid floating point operation

Posted: Thu 29 Sep 2016 11:38
by sandy771
Hi

Using UniDac SQLite with Builder XE3

Table with schema

CREATE TABLE unix10and13 (dt int)

with the data as below:
1234345087123

The following query causes an invalid floating point operation exception

UniQuery1->SQL->Clear();
UniQuery1->SQL->Add("select DateTime(unix10and13.dt, 'unixepoch') AS converted FROM unix10and13");
UniQuery1->Execute();

with the data as below the same query works fine.:
1234345087

In an SQLite shell the same query produces an erroneous date but does not cause an error

sqlite> select * from unix10and13;
1234345087123
sqlite> select DateTime(unix10and13.dt, 'unixepoch') AS converted FROM unix10and13;
-1413-03-01 13:07:12

This occurs in 6.4.14, 6.1.3 and 5.5.11

Thank You

Re: Invalid floating point operation

Posted: Thu 29 Sep 2016 13:23
by burdian
With SQLite is almost mandatory to disable FPU exceptions.

Code: Select all

initialization
  ...
  Set8087CW($133F);
  ...
end.

Re: Invalid floating point operation

Posted: Thu 29 Sep 2016 13:57
by sandy771
Thank you - that worked

Re: Invalid floating point operation

Posted: Fri 30 Sep 2016 10:09
by MaximG
For detailed issue investigation, please compose a small complete sample demonstrating the issue, including scripts for creating and filling in the table with data used in the sample, and send it to maximg*devart*com

Re: Invalid floating point operation

Posted: Fri 30 Sep 2016 10:13
by sandy771
Hi Maxim

The issue is sorted - but everything you need to recreate the issue was in my initial post.

It's a three line program