Firebird - problem with ftBytes

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
chkaufmann
Posts: 82
Joined: Sat 01 Jul 2006 11:42

Firebird - problem with ftBytes

Post by chkaufmann » Thu 21 Aug 2014 13:27

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

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: Firebird - problem with ftBytes

Post by ZEuS » Fri 22 Aug 2014 08:00

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.

chkaufmann
Posts: 82
Joined: Sat 01 Jul 2006 11:42

Re: Firebird - problem with ftBytes

Post by chkaufmann » Mon 01 Sep 2014 13:15

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

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Firebird - problem with ftBytes

Post by ViktorV » Thu 04 Sep 2014 07:58

We are going to release UniDAC next week.

Post Reply