Skip to content

Commit

Permalink
Return ErrBadConn in Prepare (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Nov 14, 2019
1 parent b57978c commit b4242ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ func (mc *mysqlConn) Prepare(query string) (driver.Stmt, error) {
// Send command
err := mc.writeCommandPacketStr(comStmtPrepare, query)
if err != nil {
return nil, mc.markBadConn(err)
// STMT_PREPARE is safe to retry. So we can return ErrBadConn here.
errLog.Print(err)
return nil, driver.ErrBadConn
}

stmt := &mysqlStmt{
Expand Down

0 comments on commit b4242ba

Please sign in to comment.