From 8ae0ee52df8fecaa8159d55179239e79ac19665e Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sat, 18 May 2024 16:10:16 +0900 Subject: [PATCH] revert Prepare change --- connection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connection.go b/connection.go index 3644464e7..3e8fb5722 100644 --- a/connection.go +++ b/connection.go @@ -171,7 +171,9 @@ func (mc *mysqlConn) Prepare(query string) (driver.Stmt, error) { // Send command err := mc.writeCommandPacketStr(comStmtPrepare, query) if err != nil { - return nil, err + // STMT_PREPARE is safe to retry. So we can return ErrBadConn here. + mc.log(err) + return nil, driver.ErrBadConn } stmt := &mysqlStmt{