[patch_done] Wrong parameter type SmallInt vs. Byte

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
Post Reply
Alfa000
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: 05.12.2012, 09:09

[patch_done] Wrong parameter type SmallInt vs. Byte

Post by Alfa000 »

Hello. Method IZPreparedStatement.SetByte have wrong datatype for parameter Value. There is ShortInt, but should by Byte or bigger unsigned type. In my case this caused cut of all values bigger than 127 a store them as 0! I replace this datatype and all works well. Sorry for my poor english.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Alfa000,

don't worry about your english!

Can you explain some more details?
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
Alfa000
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: 05.12.2012, 09:09

Post by Alfa000 »

Explain is simple:

Interface IZPreparedStatement have this method:

Code: Select all

procedure SetByte(ParameterIndex: Integer; Value: ShortInt);
but correct declaration should by like this:

Code: Select all

procedure SetByte(ParameterIndex: Integer; Value: Byte);
What you say?

I don't have time for precise reproducing problem now. But if i was trying store whole byte range (from 0 to 255) with IZPreparedStatement.SetByte and IZPreparedStatement.ExecuteUpdatePrepared, then values greather than 127 was stored as 0 in database. If i replace parameter declaration "Value: ShorInt" for "Value: Byte", then whole range from 0 to 255 is stored ok.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Alfa000,

i think you are right! Which database are you using for? I'll check your suggestion. If i can't find new issues, i'll commit the patch to SVN.

Edit: Patch done R2247 /testing7.1 (SNV)

Thank you.
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
Alfa000
Fresh Boarder
Fresh Boarder
Posts: 18
Joined: 05.12.2012, 09:09

Post by Alfa000 »

You are welcome. Good work about ZeosLib. In this case i use MySQL 5.5.
Daniel Andrascik
Post Reply