Bug report: Reading a date field returns gibberish

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Bug report: Reading a date field returns gibberish

Post 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?
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Post 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?
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Post 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?
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Post 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?
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Post 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.
jirka
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 25.10.2005, 07:08

Lazarus+MSSQL

Post by jirka »

I have same problem in Lazarus+MSSQL Server 2000

Jirka
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Post by IgD »

Are there any ZeosLib developers around who could help verify the problem and find a fix if necessary?
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Post by IgD »

Is there anyone from the ZeosLib team who could help? This bug is a show stopper for me.
IgD
Zeos Dev Team
Zeos Dev Team
Posts: 43
Joined: 15.10.2005, 07:18
Location: Okinawa, Japan
Contact:

Post by IgD »

Bump
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post 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...
Post Reply