We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33b7747 commit 8a24bdfCopy full SHA for 8a24bdf
connection.go
@@ -132,7 +132,7 @@ func (mc *mysqlConn) Close() (err error) {
132
}
133
134
mc.cleanup()
135
-
+ mc.clearResult()
136
return
137
138
@@ -147,13 +147,16 @@ func (mc *mysqlConn) cleanup() {
147
148
// Makes cleanup idempotent
149
close(mc.closech)
150
- if mc.netConn == nil {
+ nc := mc.netConn
151
+ if nc == nil {
152
153
- if err := mc.netConn.Close(); err != nil {
154
- mc.cfg.Logger.Print(err)
+ if err := nc.Close(); err != nil {
155
+ mc.log(err)
156
- mc.clearResult()
157
+ // This function can be called from multiple goroutines.
158
+ // So we can not mc.clearResult() here.
159
+ // Caller should do it if they are in safe goroutine.
160
161
162
func (mc *mysqlConn) error() error {
0 commit comments