Page 1 of 1

Firebird - problem with ftBytes

Posted: Thu 21 Aug 2014 13:27
by chkaufmann
My database field is 16 bytes for a guid:

MYGUID CHAR(16) CHARACTER SET OCTETS

For insert / update I initialize the TUniParam like this:

param.DataType := ftBytes;
param.ParamType := ptInput;
param.Clear;

This is all if the parameter should be set to null.

Now I get an access violation when the TUniQuery should be destroyed. The problem happens in TIBCParamDesc.FreeBuffer for my guid parameter on this line:

Marshal.FreeHGlobal(FValue);

Earlier FValue was allocated a buffer, but only one byte.

What I found is in TIBCParamDesc.SetNull, is the following line that is executed for my guid param object:

Marshal.WriteInt16(FValue, 0);

So this means, two bytes are written here to a buffer of one byte size. Not sure, if something is wrong in my initial code for setting the param or if this is a problem in the UniDac library.

cu Christian

Re: Firebird - problem with ftBytes

Posted: Fri 22 Aug 2014 08:00
by ZEuS
Thank you for the information. We have fixed the issue with an access violation when clearing a parameter of the ftBytes type. The fix will be included in the nearest UniDAC build.

Re: Firebird - problem with ftBytes

Posted: Mon 01 Sep 2014 13:15
by chkaufmann
Great. When do you expect the next UniDac build? Just for me to know, if I have to create a work arround for my next build.

cu Christian

Re: Firebird - problem with ftBytes

Posted: Thu 04 Sep 2014 07:58
by ViktorV
We are going to release UniDAC next week.