From 63e6cc7db70de4852392062fcfe18a7dcdeb1d56 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Mon, 7 Nov 2016 20:08:17 +0800 Subject: [PATCH] statment: Remove invalid connection error on multiple Close calls Fixes #450 --- statement.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/statement.go b/statement.go index ead9a6bf4..7f9b04585 100644 --- a/statement.go +++ b/statement.go @@ -24,7 +24,10 @@ type mysqlStmt struct { func (stmt *mysqlStmt) Close() error { if stmt.mc == nil || stmt.mc.netConn == nil { - errLog.Print(ErrInvalidConn) + // driver.Stmt.Close can be called more than once, thus this function + // has to be idempotent. + // See also Issue #450 and golang/go#16019. + //errLog.Print(ErrInvalidConn) return driver.ErrBadConn }