Page 1 of 1

TUniParam::LoadFromStream doesn't work properly

Posted: Fri 19 Nov 2010 17:14
by gb
Hi!

TuniParam is descendent from Dbaccess::TDAParam,
which is descendent from Db::TParam.

Most of the methods/properties of a TuniParam works
as expected when interpreted as it's ancestor
Db::TParam. However, LoadFromStream does not. It
doesn't give any error on itself, but later on when
callling ExecSQL on a TUniQuery, it'll give an access
violation reading address 0x000000.

Suming up:
TUniQuery *qr = ...;
TParam *Param = qr->ParamByName("SomeParam");

std::auto_ptrStream(new TStringStream("dummy blob"));
Stream->Position = 0;

Param->LoadFromStream(S.get(), ftOraBlob);

qr->ExecSQL(); // AV!!!

Any hints?

Posted: Mon 22 Nov 2010 08:30
by AlexP
Hello,

I can not reproduce the problem.
Please specify the following information:
- the exact version of UniDAC;
- the name and exact version of your IDE.
Also please send a complete small sample to alexp*devart*com to demonstrate the problem.

Posted: Mon 22 Nov 2010 16:45
by gb
Thank you for taking a look on it.

Unfortunatly my time slot to test UniDac has been reasigned to a later date. I'll be back into this in the next couple of months, hopefully.

Re: TUniParam::LoadFromStream doesn't work properly

Posted: Wed 03 Oct 2012 20:13
by iPath
I've came across this problem recently. It's because of Param is declared to be TParam.
The AV occurs in DBAccess/TDAParam.GetIsNull on the line [Result := TBlob(FParamObject).Size = 0]

FparamObject is NIL and the code does not test for NIL :)

If you declare Param to be TDAParam - it works :)

I was using tUniQuery.params.AddParameter - it returns TParam, but not TDAParam!

I wonder if this is normal behavior or a bug?

(Using UniDac 4.5.9)

Regards,
Petar

Re: TUniParam::LoadFromStream doesn't work properly

Posted: Mon 08 Oct 2012 12:37
by AlexP
Hello,

For the time being, to avoid AV, you should use the TDAParam class instead of TParam, or explicitly specify the parameter data type. We will investigate the possibility to modify this behaviour in one of the next versions.