!! Latest version has BLOB/Bytes length/access violation error !!

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

!! Latest version has BLOB/Bytes length/access violation error !!

Post by upscene » Thu 11 Nov 2021 11:38

Hi,

When testing my own software with the new version of IBDac (8.0.1), I noticed the component set has a problem with BLOB values.

It raises this error followed by an access violation in rtl.bpl
---------------------------
Project raised exception class EIBCError with message 'Dynamic SQL ErrorSQL error code = -303
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 16, actual 8192'.
---------------------------

The previous version I used was 7.1.3, that worked fine.

My code is transferring a character set octets (CHAR(16)) value, using raw byte with SaveToStream and LoadFromStream.

I noticed 7.4.3 has this change:
* Bug with assigning a BLOB parameter when the source data is loaded via the TParam.LoadFromStream method is fixed

Could this be related? If so, is there a code change that I can use on my end? This is an urgent issue for me.

With regards,

Martijn

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: !! Latest version has BLOB/Bytes length/access violation error !!

Post by ViktorV » Fri 12 Nov 2021 13:55

Hey Martijn!

Thanks for the reply!
In order to give you a complete and accurate answer, please compose and send us a small sample demonstrating the behavior you indicated, including scripts to create and populate database data using our contact form:
https://devart.com/company/contactform.html

Looking forward to hearing from you!

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: !! Latest version has BLOB/Bytes length/access violation error !!

Post by upscene » Mon 15 Nov 2021 13:23

Not sure what you want me to tell you.

It's simple:
1. CHAR(16), OCTETS fields (16 bytes long)
2. create two items, one is a SELECT cursor, the other is a parameterized INSERT INTO statement
3. open the cursor, make sure NOT to convert this to field type GUID
4. I copy the field value to a stream

Code: Select all

Bytes := TBytesStream.Create(TBinaryField(Field).AsBytes);
try
  Stream.CopyFrom(Bytes, Bytes.Size);
finally
  Bytes.Free;
end;
5. load the stream into the parameter

Code: Select all

if Stream is TBytesStream
then FCommand.ParamByName(ParamName).AsBytes := (Stream as TBytesStream).Bytes
else begin
  bytes := TBytesStream.Create;
  try
    bytes.LoadFromStream(Stream);
    FCommand.ParamByName(ParamName).AsBytes := bytes.Bytes;
  finally
    bytes.Free;
  end;
end;
6. execute the INSERT command

This code worked fine in an older version, fails now. No idea where 8192 comes from, the stream I pass to that latter piece of code has a length of 16 bytes.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: !! Latest version has BLOB/Bytes length/access violation error !!

Post by ViktorV » Tue 16 Nov 2021 13:26

Hi Martijn!

Thanks for the information. Please clarify this error occurs only when the DescribeParams option is enabled or regardless of its value? And what moment does AV appear when the application is closed or when Execute is executed? Also include the exact version of the DBMS version you are using.

Should you have any questions, do not hesitate to ask!

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: !! Latest version has BLOB/Bytes length/access violation error !!

Post by upscene » Tue 16 Nov 2021 13:35

Hello Viktor,

DescribeParams = True.

AV/crash on calling Execute.

Using Firebird 3 or 4.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: !! Latest version has BLOB/Bytes length/access violation error !!

Post by ViktorV » Wed 17 Nov 2021 13:28

Hi Martijn!

Kindly be informed that unfortunally we weren't able fully reproduce your situation on our side, but we were able to reproduce a similar one.
So we able to fix the bug we have reproduced and its fix will be included in the next build of IBDAC. But we can provide you a nightly build that includes this change, so you can check if this change solves the problem on your side.

To do this, please send us your license number and the version of the IDE you are using via our contact form:
https://devart.com/company/contactform.html

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: !! Latest version has BLOB/Bytes length/access violation error !!

Post by upscene » Wed 17 Nov 2021 13:33

Hello Viktor,

The problem with the nightly build, is that I use the components for Oracle, SQL Server, MySQL and PostgreSQL as well.

I would need a build of everything ;)

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: !! Latest version has BLOB/Bytes length/access violation error !!

Post by ViktorV » Wed 17 Nov 2021 14:07

Ok, no problem!
Please send us your license number and the version of the IDE you are using via our contact form:
https://devart.com/company/contactform.html

Post Reply