Page 1 of 1

problem with Options.CompressBlobMode

Posted: Mon 04 Apr 2016 04:15
by tonisanta
Hi,
I upgraded SDAC from version 6 to last version 7. Now when reading blob-data through a TMSQuery with Options.CompressBlobMode set to cbNone where the stored data has been written with CompressBlobMode set to cbServer, accessing the data (ex. SaveToFile ..) an exception is raized. With previous version 6 this worked just fine without exception.
best regards
Toni Santa
SABE SOFT

Re: problem with Options.CompressBlobMode

Posted: Tue 05 Apr 2016 06:41
by tonisanta
Hi,
could be, my request was not very clear. Below a few lines of code to reproduce the actually behavior with compressed blobs. With last version 7 writing a blobfield with CompressBlobMode set to cbServer and than reading it with property set to cbNone, the data is not uncompressed. Doing the same with previous version 6 of SDAC the returned blob-stream was uncompressed.
So in the below example the resulting newfile.pdf is not a valid pdf since it contains the compressed stream.
best regards
Toni


Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  MSConnection1.Connect;
  try
    MSConnection1.ExecSQL('create table test (ablob image)');
    MSQuery1.SQL.Text := 'select * from test';
    MSQuery1.Options.CompressBlobMode := cbServer;
    MSQuery1.Active := true;
    MSQuery1.Append;
    TBlobField( MSQuery1.FieldByName('ablob')).LoadFromFile('c:\temp\testfile.pdf');
    MSQuery1.Post;
    MSQuery1.Active := false;
    MSQuery1.Options.CompressBlobMode := cbNone;
    MSQuery1.Active := true;
    TBlobField( MSQuery1.FieldByName('ablob')).SaveToFile('c:\temp\newfile.pdf');
    MSQuery1.Active := false;
  finally
    MSConnection1.ExecSQL('drop table test');
  end;


end;

Re: problem with Options.CompressBlobMode

Posted: Mon 11 Apr 2016 12:03
by AlexP
Hello,

Thank you for the sample. We have reproduce the issue and will investigate the reasons for such behavior.

Re: problem with Options.CompressBlobMode

Posted: Thu 28 Apr 2016 07:39
by tonisanta
Hi,
will new update 7.3.11 fix this issue?
regards, Toni

Re: problem with Options.CompressBlobMode

Posted: Fri 29 Apr 2016 12:10
by AlexP
We've investigated this behavior, and found that, in earlier versions, even when CompressBlobMode = cbServer, the data were not compressed, so they could be read in any mode. Now the behavior is changed, the data are compressed correctly, so the data should be read from the server in the same mode as they were recorded.