DADataTable - Blob parameters are not serialized correctly

Hello,
I have to report an issue with blob parameters serialization in DataTables. I sometimes use DataTable parameter as a channel for a serialized TDAMemDataTable (an extra data returned together with an Exported DataTable). Using blob (variant array of byte) parameters was not working properly, so I utilized the AnsiString parameter capabilities. Unfortunately as those were removed, there is currently no other way. I have hotfixed the issue with blob parameters and it seems to be working.
Here is the patch (the stream is binary compatible with previous DA versions):

uDABin2DataStreamer.pas, function TDABin2DataStreamer.WriteParam, lines 960-961:

  Bin2_WriteAnsistringToStream(Data, 'Value');
+++  if AParam.DataType = datBlob then
+++    Bin2_BlobToStreamAsStr(Data, AParam.Value)
+++  else
  Bin2_WriteVariantAsUTF8stringToStream(Data, AParam.Value);

uDABin2DataStreamer.pas, function TDABin2DataStreamer.ReadParam, lines 984-986

else if sName = 'Size' then AParam.Size := StrToInt(sValue)
---    else if sName = 'Value' then AParam.Value := Bin2_ReadVariantasUTF8stringFromStream(Data);
+++    else if sName = 'Value' then begin
+++      if AParam.DataType = datBlob then
+++        AParam.Value:= Bin2_ReadBlobFromStream(Data)
+++      else
+++        AParam.Value := Bin2_ReadVariantasUTF8stringFromStream(Data);
+++    end
else ;

Regards from Prague,
Jaroslav

can you create a simple testcase that demonstrates this issue, pls?

Hello,
I have prepared a small sample project. It should demonstrate the issue, at least it occurs for me (czech locale, windows-1250 codepage) with unpatched RO in 99% of the time.

Regards from Prague,
Jaroslav

daSample.zip (52.6 KB)

Thanks, logged as bugs://78956

bugs://78956 got closed with status fixed.