ERangeError in GetMySQLColumnInfoFromFieldHandle

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

ga_301
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 13.09.2012, 14:28

ERangeError in GetMySQLColumnInfoFromFieldHandle

Postby ga_301 » 30.12.2012, 13:57

The type integer of the Fieldlength variable in ZdbcMySQLUtils.pas, function GetMySQLColumnInfoFromFieldHandle does not match the return type ULong of IZMySQLPlainDriver.GetFieldLength.

I get a range check error when executing my code.
Please check.

Kind regards
Gunnar Adams

User avatar
EgonHugeist
Zeos Dev Team
Zeos Dev Team
Posts: 1739
Joined: 31.03.2011, 22:38

Postby EgonHugeist » 01.01.2013, 13:30

ga_301,

hi gunnar. What happens? Currently the PULong is defined as a allways 32Bit unsigned value. Which compiler do you use? Can you provide a little example which points me to the issue?
King regards, Michael

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

Image

ga_301
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 13.09.2012, 14:28

Postby ga_301 » 03.01.2013, 12:30

Michael,
thanks for your response. I am using Delphi XE2, 32-bit with rangechecking turned on.
The method GetMySQLColumnInfoFromFieldHandle uses a local variable "fieldlength" which is declared as integer.
My issue is not with the Ulong type, but with the type of that variable in this function. I think, that assignment of an ulong to an integer variable is generally not a good idea and suggest to change the type of the fieldlength local variable in that function to either cardinal or ulong.
I am in the early stages of developing my database and it may be, that the rangecheck error I get may be caused by some unfortunate field type declaration. I have changed the type of "fieldlength" to cardinal and did not get this exception any longer.

Kind regards,
Gunnar

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 03.01.2013, 15:49

Gunnar,

I replaced this Integer by a ULong in testing7.1 branch. That should be equal to Cardinal in meaning and is more consistent with the datatype of IZMySQLPlainDriver.GetFieldLength.
(SVN Rev. 2102) Will be backported to 7.0-patches in a few weeks.

Mark
Image


Return to “ZeosLib 7.0 Beta Forum”

Who is online

Users browsing this forum: No registered users and 1 guest