Mysql Datetime format Integer Overflow Bug?

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
billarchive
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 30.09.2020, 16:46

Mysql Datetime format Integer Overflow Bug?

Post by billarchive »

Using Delphi 7 , Maria DB 10.1.25 and Zeos 7.2.4

I am having to work with a table in database where there is a field of format of 'datetime (6) ' ie 6 fractional seconds parts as opposed to the default which is (0) none.
Queries on fields with this format always seem to end with 'Integer Overflow'

The exception occurs within : function TZAbstractMySQLResultSet.GetTimestamp(ColumnIndex: Integer): TDateTime; within unit ZDbcMySqlResultSet;

at the line: if (ConSettings^.ReadFormatSettings.DateTimeFormatLen - Len) <= 4 then...

Breaking at this point with the debugger : ConSettings^.ReadFormatSettings.DateTimeFormatLen evalutes as 19,
Len as 26 and the buffer as ''1962-11-23 22:33:00.000000' You can see the datetime 6 format here. It exceptions if this line is executed.

Is there a known bug / workaround or am I missing something?
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Mysql Datetime format Integer Overflow Bug?

Post by marsupilami »

Hello billarchive,

welcome to the Forums :)
billarchive wrote: 30.09.2020, 17:06 Using Delphi 7 , Maria DB 10.1.25 and Zeos 7.2.4
Could you please try the current development version of Zeos 7.2? See https://sourceforge.net/p/zeoslib/code-0/HEAD/tree/branches/7.2-patches/. Maybe the bug is already fixed there. Zeos 7.2.4 is more than 2 years old now.

Best regards,

Jan
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Mysql Datetime format Integer Overflow Bug?

Post by EgonHugeist »

Hi billarchive,
as Jan suggest, update from (SVN)-7.2-fixes branch first if you want stay in 7.2. An exception should be thrown, but a rounding of the fractions seems to be required.

Note 7.3 (SVN)\trunk and \testing-7.3 already do support those exact time/Timestamp values including the invalid '0000-00-00' date value mysql supports. On 7.3 a new records to handle such fields corectly. So download a snapshot if you are not using SVN. Have fun.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply