On 15-09-2023 09:31, Vlad Khorsun wrote:
> As I understand the problem is with reading that data by application.
That error is just a symptom of reading the invalid data, and how they
detected the problem. The actual problem is that the invalid data ended
up in the database.
> Are you sure error is raised on blob id = 0 ? It looks very strange
> that with the same
> data Firebird raised error when using one tool (DBeaver) while no error
> with another tool
> (IBE). Can it be that DBeaver (or some code below it) passed not 0 as
> blob id but something
> else, really invalid ? Engine handles blob id 0 without error, as we
> found, i.e. it looks
> like something else happens.
I'm sure of it, because I have a copy of the affected table. And the
reason that DBeaver throws an error is because DBeaver also uses
Jaybird, and Jaybird considers blob id 0 invalid and throws an exception
if asked to read a blob with id 0.
To be clear, Jaybird itself is throwing the isc_bad_segstr_id; it
doesn't ask the server for the blob, and it is not the server raising
the error.
On the other hand IBExpert (and ISQL) will simply request blobs with id
0, which the server then treats as an empty blob, so that wouldn't raise
an error.
> To investigate the issue, I can prepare custom build that reports
> wrong blob id value among
> with the original error (isc_bad_segstr_id). Or user could prepare
> simplest .exe for me that
> reads data and makes Firebird raise error.
The error is a symptom, and the invalid id is 0 (confirmed both with
ISQL, and by inspecting variables with a debugger when querying through
Jaybird).
> As we have found, blob id 0 could have been stored into the database
> at any time in the
> past, so this is not something we should be looking at, I believe.
If blobs with id 0 had ended up in the database before, they would
already have had that problem in earlier versions. In any case, I think
we'll need to wait for the reporter to have a reproducible case.
Mark
--
Mark Rotteveel