[fpc-pascal] Cannot write datetime field on sqlite3 database on ARM
Toru Takubo
takubo at e-parcel.co.jp
Wed Mar 10 04:58:58 CET 2021
On 2021/03/10 5:40, Florian Klämpfl via fpc-pascal wrote:
> Am 09.03.21 um 01:47 schrieb Toru Takubo via fpc-pascal:
>> On 2021/03/08 16:54, Michael Van Canneyt via fpc-pascal wrote:
>>>
>>>
>>> On Mon, 8 Mar 2021, Toru Takubo via fpc-pascal wrote:
>>>
>>>> Hi,
>>>>
>>>> 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)
>>>> field.
>>>>
>>>> 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.
>>>
>>
>> I created a simple test code, and ran on linux-i386 and linux-arm.
>
> Can you please post the output of -va of the arm compiler and provide some information about the arm system you are using?
The output message with -va option can be downloaded from below.
http://support.e-parcel.ne.jp/downloads/tmp/fpc-va.txt
Target machine is Raspberry Pi OS on Raspberry Pi 3 Model B V1.2.
# uname -a
Linux raspberrypi 5.4.51-v7+ #1327 SMP Thu Jul 23 10:58:46 BST 2020 armv7l GNU/Linux
Best Regards,
Toru
More information about the fpc-pascal
mailing list