Page 1 of 1

Bug report: Reading a date field returns gibberish

Posted: 16.10.2005, 07:34
by IgD
I'm using Lazarus with the 13 Oct 05 release of Zeoslib. I'm using MySQL V4.0.x

If I read a date from a record it returns as gibberish. However if I write a date it is saved properly.

If I do manual SQL query I can see the date is stored properly but it shows up as gibberish for example 10-10-12583. If I do a manual SQL query after writing a date field I can see the date was stored properly.

Any ideas?

Posted: 16.10.2005, 12:42
by IgD
I just tried this using MySQL V4.1.x thinking it could have been a problem with the DLL file. The same problem exists:

If I do a manual SQL query, the date is returned as 2005-10-01.

However if I retrieve the date within a Lazarus application the date is returned as 38821/10/07. Any ideas?

Posted: 17.10.2005, 11:59
by IgD
One of the Lazarus developers reviewed this and here is what they had to say:
FPC uses internally the TDateTime type for date-fields. But Delphi versions lower then Delphi 5 uses another type.

The problem is probably that ZEOS doesn't recognize fpc as a delphi version which uses TDateTime, so it uses the older type. Maybe it's even hardcoded, since older versions of FPC used the same system as lower Delphi versions.

So I think it's a ZEOS-bug, which they can fix very easily. They have to use the same code as they use for Delphi 5 and up. And not the code for Delphi 4 and lower. Probably a simple ifdef should fix that.

I change the status to resolved, you can submit a bugreport to ZEOS, and close this bug if they got this solved, of post a note it this appears to be another problem. (btw: this is a fpc-issue, not a lazarus one)
Can someone from the Zeos team please check this out?

Posted: 19.10.2005, 00:09
by IgD
Just for fun, I installed ZeosLib 6.5.1 13 Oct 05 under Delphi 7 and tried it. There is no problem with D7. It must be a Lazarus only problem?

Posted: 21.10.2005, 23:25
by IgD
I created a bug report about this issue on the SF site:
http://sourceforge.net/tracker/index.ph ... tid=415824

Does anyone have any ideas on how to fix this? It sounds like a real easy fix.

Lazarus+MSSQL

Posted: 25.10.2005, 07:16
by jirka
I have same problem in Lazarus+MSSQL Server 2000

Jirka

Posted: 27.10.2005, 11:50
by IgD
Are there any ZeosLib developers around who could help verify the problem and find a fix if necessary?

Posted: 04.11.2005, 00:44
by IgD
Is there anyone from the ZeosLib team who could help? This bug is a show stopper for me.

Posted: 12.11.2005, 23:48
by IgD
Bump

Posted: 05.03.2006, 23:40
by zippo
Idea: Could be a fieldsize problem. Try to check the DBGrid (if using one) regarding property. I once had a similar problem and it was just a FieldSize/DisplaySize problem...