Skip to content

Fix Firebird development server version parsing - #74

Open
Pavlushechko wants to merge 3 commits into
FirebirdSQL:mainfrom
Pavlushechko:36-incorrect-parsing-of-version-strings-for-development-firebird-builds
Open

Pavlushechko wants to merge 3 commits into
FirebirdSQL:mainfrom
Pavlushechko:36-incorrect-parsing-of-version-strings-for-development-firebird-builds

Conversation

@Pavlushechko

Copy link
Copy Markdown

Fixes #36.

Firebird snapshots can report versions such as LI-T6.0.0.2459 Firebird 6.0 2f725cf. The previous parser required -V, so connecting to a snapshot could fail while parsing the server version.

  • Accept a single \w build-type character, including V, T, and X, and optional revision suffixes such as -dev.
  • Decode the length-prefixed isc_info_firebird_version entries and parse the first entry.
  • Use the same version parser for database and Service Manager responses while preserving the public ServerVersion API.

Added regression tests for snapshot versions, revision suffixes, and database responses with multiple or malformed entries. Updated the Sweep fixture to match the Service Manager response format.

Verified in WSL against Firebird 6 snapshot LI-T6.0.0.2526 with go test -p 1 -count=1 ./.... All packages passed.

@smirnoffjr
smirnoffjr requested a review from MrTeeett December 3, 2026 06:55
Comment thread fbconn/server_version.go Resolved
Comment thread fbconn/server_version_test.go Resolved
Comment thread fbconn/server_version_test.go Resolved
Comment thread fbconn/server_version_test.go Outdated
for name, entries := range map[string][]byte{
"missing count": nil,
"zero count": {0},
"missing entry": {1},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With {1}, the test can still pass if the decoder ignores the missing entry, because parsing an empty version also returns an error. I suggest using a count of two followed by a single valid version entry. That way, the test fails if the decoder accepts the incomplete response.

Suggested change
"missing entry": {1},
"missing second entry": append([]byte{2, byte(len(version))}, version...),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The test now declares two entries and includes one valid version. It fails if the decoder accepts the response with the second entry missing.

@smirnoffjr

Copy link
Copy Markdown
Collaborator

Please, no generic messages in commits like "fixed bug" or "fixed some after review" like in 4e0e870. Commit message must contain short description why those changes made.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect parsing of version strings for development firebird builds

3 participants