Subject Re: [firebird-support] Re: Working with stream blobs at API level
Author Vlad Khorsun
>> Ensure your BPB is correct. For example
>>
>> {isc_bpb_version1, isc_bpb_type, 1, isc_bpb_type_stream}
>>
>
> Hi Vlad, thanks for answering.
>
> The BPB is correct, but allow me to elaborate my problem:
>
> The blob is created with type stream indeed, as per isc_blob_info(), but it still behaves as a segmented blob. What do I mean by
> that:
>
> 1) I can read and write it with isc_get/put_segment().

Of course.

> 2) isc_blob_info() shows correct number of segments and max. segment size.

Why not ?

> 3) reading the blob with isc_get_segment() does reads it in the exact same segments as it was written.

I.e. if you supply buffer with size > max segment size above it anyway returns
no more than max segment size bytes ?

> 4) on a type 1 blob, isc_seek_blob() doesn't wanna seek and always returns 1.
> 5) on a type 0 blob isc_seek_blob() doesn't report an error in the status vector, but returns a garbage number instead.

Hmm...

> Now,
>
> I notice Bopen and BLOB_put are just light wrappers on top of isc_open_blob2, isc_put_segment respectively, so there's
> really no separate stream blob API underneath, which validates points 1,2,3. Can someone infirm/confirm this?

Yes, it is so and always was so.

> My problem really is with number 4 -- can someone confirm that isc_seek_blob() is really working in v2.5b2 ?
> I can't seem to find any C test case for this function.

What is "type 1" blob ? Do you mean blob subtype or kind of blob (stream\segmented) ?

It will be better if you'll create small sample application and show it here.
If you doing something wrong - we will find it. If there is bug in Firebird - we
will attach this sample into tracker and fix the bug.

Regards,
Vlad