Skip to content

Commit 85c6311

Browse files
authoredJan 23, 2025··
Add error 1290/ER_READ_ONLY_MODE to rejectReadOnly handling (#1660)
1 parent 255d1ad commit 85c6311

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎packets.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ func (mc *mysqlConn) handleErrorPacket(data []byte) error {
574574

575575
// 1792: ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
576576
// 1290: ER_OPTION_PREVENTS_STATEMENT (returned by Aurora during failover)
577-
if (errno == 1792 || errno == 1290) && mc.cfg.RejectReadOnly {
577+
// 1836: ER_READ_ONLY_MODE
578+
if (errno == 1792 || errno == 1290 || errno == 1836) && mc.cfg.RejectReadOnly {
578579
// Oops; we are connected to a read-only connection, and won't be able
579580
// to issue any write statements. Since RejectReadOnly is configured,
580581
// we throw away this connection hoping this one would have write

0 commit comments

Comments
 (0)
Please sign in to comment.