Page 1 of 1
[patch_done] Wrong parameter type SmallInt vs. Byte
Posted: 18.05.2013, 13:55
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.
Posted: 20.05.2013, 19:17
by EgonHugeist
Alfa000,
don't worry about your english!
Can you explain some more details?
Posted: 23.05.2013, 15:08
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.
Posted: 24.05.2013, 08:24
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.
Posted: 24.05.2013, 22:12
by Alfa000
You are welcome. Good work about ZeosLib. In this case i use MySQL 5.5.