From 3725e7f6b29e1139a1fd3e9ee7c7c786c34b7b60 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Wed, 13 Nov 2024 16:42:34 +0900 Subject: [PATCH] fixup --- connection.go | 2 +- packets.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index 9d21f555..93a51b01 100644 --- a/connection.go +++ b/connection.go @@ -344,10 +344,10 @@ func (mc *mysqlConn) Query(query string, args []driver.Value) (driver.Rows, erro func (mc *mysqlConn) query(query string, args []driver.Value) (*textRows, error) { handleOk := mc.clearResult() + if mc.closed.Load() { return nil, driver.ErrBadConn } - if len(args) != 0 { if !mc.cfg.InterpolateParams { return nil, driver.ErrSkip diff --git a/packets.go b/packets.go index b5621c92..0dab3837 100644 --- a/packets.go +++ b/packets.go @@ -117,8 +117,8 @@ func (mc *mysqlConn) writePacket(data []byte) error { // Write packet if mc.writeTimeout > 0 { if err := mc.netConn.SetWriteDeadline(time.Now().Add(mc.writeTimeout)); err != nil { - mc.log(err) mc.cleanup() + mc.log(err) return err } }