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
ERangeError in GetMySQLColumnInfoFromFieldHandle
Moderators: gto, EgonHugeist, olehs
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
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?
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?
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/
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/
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
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