GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support higher maximum blob segment size (#1197) by fdcastel · Pull Request #1264 · FirebirdSQL/NETProvider

Conversation

@fdcastel

@fdcastel fdcastel commented Mar 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes #1197.

Summary

This PR implements support for blob segment sizes up to 65535 bytes (64 KiB − 1), as supported by Firebird since version 2.1 (and fully reliable in Firebird 3.0+).

Changes

New BlobSegmentSize connection string property

  • BlobSegmentSize is a new connection string key (synonym: blobsegmentsize) that controls the segment size used when reading/writing blobs.
  • Valid range: 512–65535 bytes. Default: 8192 bytes (same as the PacketSize default, so default behavior is unchanged).
  • Exposed via FbConnectionStringBuilder.BlobSegmentSize and FbConnection.BlobSegmentSize.

PacketSize is unchanged

  • PacketSize keeps its meaning: it sizes the socket send/receive buffers of the managed client. It is just no longer (ab)used as the blob segment size.
  • DatabaseBase.PacketSize was unused once blobs read BlobSegmentSize, so it was removed (together with the packetSize parameter of FesDatabase). GdsConnection.PacketSize remains, as the only consumer.

Raised wire protocol limits

  • GdsBlob.GetSegment (all 4 variants): cap changed from short.MaxValue - 12 (32755) to ushort.MaxValue (65535).
  • XdrReaderWriter.WriteBlobBuffer: guard changed from short.MaxValue to ushort.MaxValue.
  • IFbClient.isc_get_segment / isc_put_segment: parameter types changed from short / ref short to ushort / ref ushort, matching the Firebird C API's actual unsigned short types. FesBlob updated accordingly.

Stack plumbing

BlobSegmentSize flows through the full stack:

ConnectionString.BlobSegmentSize
  → GdsConnection.BlobSegmentSize / FesDatabase(blobSegmentSize)
  → DatabaseBase.BlobSegmentSize  (replaces DatabaseBase.PacketSize)
  → BlobBase._segmentSize  (was db.PacketSize, now db.BlobSegmentSize)

Tests

  • ConnectionStringTests: 6 new tests (default, parsing, synonym, validation boundaries).
  • FbConnectionStringBuilderTests: 3 new tests (default, setter, getter).
  • FbBlobTests: 2 new integration tests exercising blob read/write with BlobSegmentSize = 65535.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cincuranet
cincuranet reviewed Oct 9, 2026
View reviewed changes

@cincuranet cincuranet left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the obsoletion of PacketSize, I don't think we should put the attribute there. It is still valid setting for socket.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/FirebirdSql.Data.FirebirdClient.Tests/ConnectionStringTests.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/FirebirdSql.Data.FirebirdClient.Tests/ConnectionStringTests.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/FirebirdSql.Data.FirebirdClient.Tests/ConnectionStringTests.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/FirebirdSql.Data.FirebirdClient.Tests/ConnectionStringTests.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/FirebirdSql.Data.FirebirdClient.Tests/ConnectionStringTests.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/FirebirdSql.Data.FirebirdClient/Common/DatabaseBase.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

fdcastel added 2 commits November 7, 2026 09:07
@fdcastel
Support higher maximum blob segment size (issue FirebirdSQL#1197)
c7572ac
- Add new 'BlobSegmentSize' connection string property (range 512-65535 bytes)
  replacing the blob-specific role of PacketSize
- Deprecate PacketSize on FbConnectionStringBuilder and FbConnection
  (use BlobSegmentSize instead)
- Raise wire protocol blob segment limit from 32767 to 65535 bytes in
  GdsBlob, XdrReaderWriter (WriteBlobBuffer) and the native IFbClient
  interface (isc_get_segment / isc_put_segment now take unsigned shorts)
- Plumb BlobSegmentSize through the full stack:
  ConnectionString -> GdsConnection / FesDatabase -> DatabaseBase ->
  BlobBase._segmentSize
- Add tests for: connection string parsing/synonyms/validation,
  FbConnectionStringBuilder getter/setter, and blob read/write with
  BlobSegmentSize=65535

Fixes FirebirdSQL#1197
@fdcastel
Address review feedback on FirebirdSQL#1264
9f9cb4f
- Keep PacketSize as a regular (non-obsolete) setting: it still sizes the
  socket send/receive buffers of the managed client.
- Remove the now-unused DatabaseBase.PacketSize (and the packetSize
  parameter of FesDatabase); GdsConnection is its only consumer.
- Tests: follow the file's `const string ConnectionString` naming, drop the
  redundant BlobSegmentSizeValidationMaxBoundary test and fold its
  Validate() check into BlobSegmentSizeParsing.
@fdcastel
fdcastel force-pushed the fix-issue-1197 branch from 1172b33 to 9f9cb4f Compare November 7, 2026 13:22
@fdcastel

fdcastel commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Regarding PacketSize: agreed, dropped [Obsolete] and left PacketSize exactly as on master. It is the socket buffer setting, and BlobSegmentSize is separate.

Also rebased onto current master; the review changes are in a separate commit (9f9cb4f) for easier re-review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cincuranet cincuranet cincuranet left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support higher maximum blob segment size

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@fdcastel @cincuranet
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.