• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

block / mysql / 34064861637
85%

Build:
DEFAULT BRANCH: master
Ran 06 Sep 2026 10:45PM UTC
Jobs 5
Files 21
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Sep 2026 10:43PM UTC coverage: 84.767% (+0.2%) from 84.528%
34064861637

push

github

web-flow
Always reject read-only connections (#5)

* Always reject read-only connections

Upstream makes this an option (rejectReadOnly) defaulting to off. It is
unconditional here, and Config.RejectReadOnly is gone.

The failure it prevents is silent, and the mistake that causes it is invisible.
RDS and Aurora fail over by moving DNS: a pooled connection to the demoted
writer stays open and stays usable, and every write on it fails for as long as
the pool keeps it — potentially until the process restarts. Nothing in the DSN
or in the error says the connection is the problem, so a deployment that left
the option off does not find out until a failover, which is the worst possible
moment to learn it. An option whose only correct setting in the environment we
deploy in is "on" is not really an option; it is a step you can forget.

What happens to the parameter: rejectReadOnly=true still parses and does
nothing, so a DSN written for upstream keeps working. rejectReadOnly=false is
an error rather than a silent no-op — it states an expectation the driver will
not meet, and quietly ignoring it is the same class of problem this change
exists to remove.

One carve-out, which upstream's own test suite found: a transaction opened with
driver.TxOptions.ReadOnly is exempt. There the read-only error is the answer
the caller asked for, and database/sql does not retry inside a transaction, so
rejecting would replace a usable *MySQLError with a dead transaction —
TestContextBeginReadOnly failed exactly that way before the exemption, and
passes unmodified with it. A session the application makes read-only with its
own SET is deliberately not exempt: nothing distinguishes it from a demoted
writer.

Upstream's TestRejectReadOnly loses the case where the option is off, since
that is no longer a state the driver can be in; the first case now covers a DSN
that says nothing, which is where the old default did the wrong thing.

Full suite passes against MySQL 8.0.44, race enabled.

* ... (continued)

45 of 45 new or added lines in 4 files covered. (100.0%)

1 existing line in 1 file now uncovered.

3617 of 4267 relevant lines covered (84.77%)

328350.56 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
85.92
0.38% dsn.go
Jobs
ID Job ID Ran Files Coverage
1 Linux-Go-1.27-DB-9.7 - 34064861637.1 06 Sep 2026 10:45PM UTC 21
81.88
GitHub Action Run
2 Linux-Go-1.25-DB-9.7 - 34064861637.2 06 Sep 2026 10:46PM UTC 21
83.15
GitHub Action Run
3 Linux-Go-1.26-DB-9.7 - 34064861637.3 06 Sep 2026 10:45PM UTC 21
83.08
GitHub Action Run
4 Linux-Go-1.27-DB-8.0 - 34064861637.4 06 Sep 2026 10:46PM UTC 21
81.88
GitHub Action Run
5 Linux-Go-1.27-DB-8.4 - 34064861637.5 06 Sep 2026 10:45PM UTC 21
81.82
GitHub Action Run
Source Files on build 34064861637
  • Tree
  • List 21
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ee0a93fe on github
  • Prev Build on master (#34064809572)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc