mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Update vendoring
This commit is contained in:
15
vendor/github.com/go-sql-driver/mysql/packets.go
generated
vendored
15
vendor/github.com/go-sql-driver/mysql/packets.go
generated
vendored
@@ -551,6 +551,21 @@ func (mc *mysqlConn) handleErrorPacket(data []byte) error {
|
||||
// Error Number [16 bit uint]
|
||||
errno := binary.LittleEndian.Uint16(data[1:3])
|
||||
|
||||
// 1792: ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
|
||||
if errno == 1792 && mc.cfg.RejectReadOnly {
|
||||
// Oops; we are connected to a read-only connection, and won't be able
|
||||
// to issue any write statements. Since RejectReadOnly is configured,
|
||||
// we throw away this connection hoping this one would have write
|
||||
// permission. This is specifically for a possible race condition
|
||||
// during failover (e.g. on AWS Aurora). See README.md for more.
|
||||
//
|
||||
// We explicitly close the connection before returning
|
||||
// driver.ErrBadConn to ensure that `database/sql` purges this
|
||||
// connection and initiates a new one for next statement next time.
|
||||
mc.Close()
|
||||
return driver.ErrBadConn
|
||||
}
|
||||
|
||||
pos := 3
|
||||
|
||||
// SQL State [optional: # + 5bytes string]
|
||||
|
||||
Reference in New Issue
Block a user