Skip to content

db prepare return invalid connection #983

Closed
@richmonkey

Description

@richmonkey

Issue description

when net conn write error, why ErrInvalidConn , but not driver.ErrBadConn?

Example code

//setup two connection(equal const maxBadConnRetries = 2)
conn1, _ := db.Conn(context.Background())
conn2, _:= db.Conn(context.Background())
conn1.Close()
conn2.Close()

Then restart mysql server, now the connections in the pool all bad.

db.prepare()

Error log

If you have an error log, please paste it here.

Configuration

Driver version (or git SHA):

Go version: run go version in your console

Server version: E.g. MySQL 5.6, MariaDB 10.0.20

Server OS: E.g. Debian 8.1 (Jessie), Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions