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?
TUniParam::LoadFromStream doesn't work properly
Re: TUniParam::LoadFromStream doesn't work properly
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
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
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.
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.