Invalid batch creation parameters - no errors reported

24 views
Skip to first unread message

Tomasz Tyrakowski

unread,
Sep 8, 2026, 7:11:30 AMSep 8
to firebird-support
Hi

Just to wrap my head around it.

What actually happens when I create a batch (IAttachment::createBatch)
and provide invalid values for TAG_DETAILED_ERRORS (negative or >256) or
TAG_BUFFER_BYTES_SIZE (negative or >256M) in the parameters block?
Checking it empirically, I don't get any errors (the batch gets created
with buffer size = -1 and detailed errors = -1 or 1000, I can add
messages and execute the batch, all without errors, the outcome of the
statements are visible in the database, so the batch really did work).
Does it mean the invalid values are clipped automatically (to 256 or
256M, respectively), or set to defaults (64 / 16M)?
What about negative values? Do they get clipped? To which values
(minimal possible / default)?
Can't find anything about it in Using_OO_API.html, if there's another
document describing it, I'd much appreciate pointing it out.

Thanks in advance.

regards
Tomasz



Mark Rotteveel

unread,
Sep 8, 2026, 7:43:43 AMSep 8
to firebird...@googlegroups.com
On 08-09-2026 13:11, Tomasz Tyrakowski wrote:
> Just to wrap my head around it.
>
> What actually happens when I create a batch (IAttachment::createBatch)
> and provide invalid values for TAG_DETAILED_ERRORS (negative or >256) or
> TAG_BUFFER_BYTES_SIZE (negative or >256M) in the parameters block?


For TAG_DETAILED_ERRORS, too large values are restricted to the
server-side supported maximum (256 items at this time).

For TAG_BUFFER_BYTES_SIZE, too large values are restricted to the
server-side supported maximum (256MiB at this time), zero applies 256
MiB, Too small values will use at least 128KiB, or the size needed for
two rows.

For both tags, the value is stored in an unsigned datatype (going by the
Firebird 6 code), so negative values will actually be (usually) very
large positive values, and thus capped at the server-side maximum.

The defaults are only applied when you don't include the tag in the
parameter buffer.


[..]
> Can't find anything about it in Using_OO_API.html, if there's another
> document describing it, I'd much appreciate pointing it out.


Basically, the only documentation for this specifically is the code in
DsqlBatch.cpp.

Mark
--
Mark Rotteveel

Tomasz Tyrakowski

unread,
Sep 8, 2026, 8:05:10 AMSep 8
to firebird...@googlegroups.com
On 8.09.2026 at 13:43, 'Mark Rotteveel' via firebird-support wrote:
> On 08-09-2026 13:11, Tomasz Tyrakowski wrote:
>> [...]
> For both tags, the value is stored in an unsigned datatype (going by the
> Firebird 6 code), so negative values will actually be (usually) very
> large positive values, and thus capped at the server-side maximum.
>
> The defaults are only applied when you don't include the tag in the
> parameter buffer.
>
> [..]
> Basically, the only documentation for this specifically is the code in
> DsqlBatch.cpp.
Thank you Mark for a prompt reply. It answers all my questions.

regards
Tomasz



Reply all
Reply to author
Forward
0 new messages