Subject UDF blows database
Author mircostange
I have asked this question before but despite one reply, I didn't get
any further.

The issues is that we have developed a custom UDF to convert BLOBs
containing vector images into BLOBs containing bitmap images.

The idea is to have a BLOB UDF "ProPXMakeBitmap(data,scale)" which
takes a BLOB and scaling factor and is supposed to produce a new BLOB
(not changing the existing one) containing a bitmap image.

To access this functionality, we have created a view

CREATE VIEW "SAMPLEATTACHMENTBMP" (
"SAMPLEGROUPID",
"KIND",
"DATA"
) AS
SELECT
sampleGroupID, kind, ProPXMakeBitmap(data,1.5)
FROM
SampleAttachment
WHERE format='EMF'


I would expect Interbase to just create temporary BLOBs for the
result set as long as someone has a select statement on the view open
and remove the BLOBs when the statement is closed. So reading from
the view should not increase the database size.

However, whenever we execute

select * from sampleattachmentbmp;
commit;

the database size increases 15 or more MB. After a number of selects,
the size easily reaches +700 MB. There is no other user connected and
as far as I can tell, no other pending transaction.

Someone indicated that there might be something wrong with our UDF,
but I have no idea what kind of error could have this effect.

I need some help!

Mirco