[fpc-pascal] Cannot write datetime field on sqlite3 database on ARM
Michael Van Canneyt
michael at freepascal.org
Mon Mar 8 08:54:43 CET 2021
On Mon, 8 Mar 2021, Toru Takubo via fpc-pascal wrote:
> I am developing my app on Windows and building apps for other
> platforms by using cross compiler. Now I have a problem only
> occurred on Linux ARM.
> The problem is that it cannot write datetime field on sqlite3
> database. It can read/write other fields like int, varchar
> or blob, but always write zero in datetime (maybe float as well)
> Does anyone have an idea about this issue? I am not sure it is
> fpc issue, but better to report bug?
It sounds like a floating point problem. As you probably know, a TDateTime
type is actually a double type. Did you try with a float value ?
The DB explorer tools probably just use strings to read/write from the
database, so they will not be bothere by such things, but FPC stores dataset
values in 'native' formats in memory.
I don't know what to advise to further investigate the issue, One thing to
try would be to test whether normal float arithmetic or date arithmetic works.
If not, then the compiler people will need to give more advice.
More information about the fpc-pascal