Skip to content

Commit

Permalink
Add error 1290/ER_READ_ONLY_MODE to rejectReadOnly handling (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolbe authored Jan 23, 2025
1 parent 255d1ad commit 85c6311
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packets.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ func (mc *mysqlConn) handleErrorPacket(data []byte) error {

// 1792: ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
// 1290: ER_OPTION_PREVENTS_STATEMENT (returned by Aurora during failover)
if (errno == 1792 || errno == 1290) && mc.cfg.RejectReadOnly {
// 1836: ER_READ_ONLY_MODE
if (errno == 1792 || errno == 1290 || errno == 1836) && 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
Expand Down

0 comments on commit 85c6311

Please sign in to comment.