Invalid floating point operation

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Invalid floating point operation

Post by sandy771 » Thu 29 Sep 2016 11:38

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

burdian
Posts: 29
Joined: Wed 19 Nov 2008 19:25

Re: Invalid floating point operation

Post by burdian » Thu 29 Sep 2016 13:23

With SQLite is almost mandatory to disable FPU exceptions.

Code: Select all

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

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: Invalid floating point operation

Post by sandy771 » Thu 29 Sep 2016 13:57

Thank you - that worked

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Invalid floating point operation

Post by MaximG » Fri 30 Sep 2016 10:09

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

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Re: Invalid floating point operation

Post by sandy771 » Fri 30 Sep 2016 10:13

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

Post Reply