Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 85c6311

Browse files
authored
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

Lines changed: 2 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /