Skip to content

Support the new database/sql scanning mechanism in Go 1.27. - #35

Open
P1cheneG wants to merge 4 commits into
FirebirdSQL:mainfrom
P1cheneG:support_new_database/sql_scanning_mechanism_in_Go_1.27
Open

P1cheneG wants to merge 4 commits into
FirebirdSQL:mainfrom
P1cheneG:support_new_database/sql_scanning_mechanism_in_Go_1.27

Conversation

@P1cheneG

@P1cheneG P1cheneG commented Nov 9, 2026

Copy link
Copy Markdown

No description provided.

@P1cheneG
P1cheneG requested a review from RozmiDan November 9, 2026 09:11
@P1cheneG P1cheneG self-assigned this Nov 9, 2026
@P1cheneG P1cheneG added this to the v0.8.0 milestone Nov 9, 2026
Comment thread stdlib/sql_go1.27.go
return errors.New("destination not a pointer")
}
rv := reflect.ValueOf(dest)
if rv.Kind() == reflect.Pointer && rv.IsNil() {

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.

This changes the existing database/sql behavior for typed-nil sql.Scanner values: their Scan method used to be called and could handle a nil receiver, but this check rejects them before that call. Is this intentional, or should we preserve the previous behavior? A test would help make the intended behavior explicit.

select {
case <-called:
case err := <-called:
require.ErrorIs(t, err, net.ErrClosed)

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.

This branch means the handler was called more than once, which is already a test failure regardless of the error. Why do we expect net.ErrClosed here when the test only passes firstErr and secondErr? Seems we can include err in t.Fatalf instead, so the failure reports the unexpected extra call rather than an unrelated error mismatch. The same applies to the early-return checks in manager_internal_test.go, compression_close_test.go, and client_compression_test.go.

@smirnoffjr smirnoffjr added the enhancement New feature or request label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants