Memory Overrun Leak executing a Stored Procedure

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lucatralli
Posts: 2
Joined: Fri 04 Dec 2009 05:17

Memory Overrun Leak executing a Stored Procedure

Post by lucatralli » Fri 04 Dec 2009 06:07

EurekaLog raise the "Overrun Memory Leak" when I free a TUniStoredProc object.

I use Firebird and the example it's very easy:

orSP := TUniStoredProc.Create(Self);
orSP.StoredProcName := 'SP_GET_NEWOID';
orSP.Connection := DataModuleMain.UniConnectionProf;
orSP.PrepareSQL(False);
orSP.ParamByName('SIGLATABELLA').AsString := 'SQLR';
orSP.Execute;
ShowMessage(orSP.ParamByName('NEW_OID').AsString);
orSP.Close;
FreeAndNil(orSP);

The result of the Stored Procedure is ok but the FreeAndNill cause the problem.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 04 Dec 2009 12:56

Please provide the code of your stored procedure.

lucatralli
Posts: 2
Joined: Fri 04 Dec 2009 05:17

Post by lucatralli » Wed 09 Dec 2009 06:17

The SP is a little bit complex and calls differents SP but I realized a simple version that you can use to reproduce the problem.

Anyway the problem is connected with the "UseUnicode" = True
The Database has many fields in unicode but not all.
This procedure returns a value not unicode.
If I remove the UseUnicode = True in the connection all works well.

/* Stored procedure you can use */

SET TERM ^ ;

create or alter procedure SP_GET_NEWOID (
SIGLATABELLA varchar(4) character set NONE)
returns (
NEW_OID char(24) character set NONE)
as
BEGIN
NEW_OID = 'A00001' || '-' || SIGLATABELLA || '0000000000001';
SUSPEND;
END^

SET TERM ; ^

GRANT EXECUTE ON PROCEDURE SP_GET_NEWOID TO SYSDBA;

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 09 Dec 2009 09:40

We have fixed this problem. The fix will be included in the next build of UniDAC.

Post Reply