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

block / mysql
83%

Build:
DEFAULT BRANCH: master
Repo Added 04 Aug 2026 01:53AM UTC
Token I1zGjvGvgv8vXRcSsaOvUeqtnobi2phNd regen
Build 10 Last
Files 21
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

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
Sync Branches
  • No branch selected
  • master
  • unified-query
  • warning-count

28 Aug 2026 03:39PM UTC coverage: 82.754% (+0.1%) from 82.606%
33186217865

push

github

web-flow
conn: expose the OK/EOF packet warning count (#2)

* conn: expose the OK/EOF packet warning count

MySQL reports how many warnings a statement raised in the packet that
terminates its response, but the driver dropped the field on the floor: a
literal `// warning count [2 bytes]` comment in handleOkPacket with no
parse behind it, and three copies of the resultset terminator reader that
skipped straight past it to the status flags.

Without the count, a caller that wants to surface warnings has only bad
options. The diagnostics themselves live in per-connection state that
only SHOW WARNINGS can read, so reading them costs a round trip; with no
count to gate on, that round trip has to be spent after every statement,
warnings or not. The count is what makes it affordable — and it is also
what a proxy needs to put in its own OK packet, since clients such as
Connector/J only ask for warnings when the count they were given is
non-zero.

Record it on the connection alongside the status flags, clear it in
clearResult() so one statement's count cannot be read as the next one's,
and expose it as (*mysqlConn).Warnings() for callers reaching the
connection through (*sql.Conn).Raw.

The three inlined resultset terminator readers collapse into one
readResultsetTerminator method. They were already identical; the warning
count made keeping them identical harder, because an EOF packet orders
warnings before status and an 0xFE-headered OK packet orders them after,
so each copy would have had to get that backwards independently.

* review: correct the warning-count lifecycle docs

Both comments on the PR were right, and both were about wording that
described an earlier draft rather than the code.

handleOkPacket no longer has a statusMoreResultsExists early return, so
"recorded before the more-results check" described a check that is not
there. Say what the code now does and why: the count is recorded
unconditionally so each statement of a multi-statement leaves its own
... (continued)

34 of 34 new or added lines in 3 files covered. (100.0%)

3455 of 4175 relevant lines covered (82.75%)

2569383.35 hits per line

Relevant lines Covered
Build:
Build:
4175 RELEVANT LINES 3455 COVERED LINES
2569383.35 HITS PER LINE
Source Files on master
  • Tree
  • List 21
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
33186217865 master conn: expose the OK/EOF packet warning count (#2) * conn: expose the OK/EOF packet warning count MySQL reports how many warnings a statement raised in the packet that terminates its response, but the driver dropped the field on the floor: a lite... push 28 Aug 2026 03:40PM UTC web-flow github
82.75
33120091003 warning-count fix: keep the warning count until the next command clearResult() was the wrong reset point. It runs at the start of every statement, but it also runs from (*mysqlRows).Close — after skipRows has already read the packet that carries the count. A c... Pull #2 27 Aug 2026 09:53PM UTC morgo github
82.66
33119442546 warning-count review: correct the warning-count lifecycle docs Both comments on the PR were right, and both were about wording that described an earlier draft rather than the code. handleOkPacket no longer has a statusMoreResultsExists early return, so "recor... Pull #2 27 Aug 2026 09:45PM UTC morgo github
82.73
33118200785 warning-count conn: expose the OK/EOF packet warning count MySQL reports how many warnings a statement raised in the packet that terminates its response, but the driver dropped the field on the floor: a literal `// warning count [2 bytes]` comment in handleOkP... Pull #2 27 Aug 2026 09:28PM UTC morgo github
82.73
33117969512 master Merge branch 'go-sql-driver:master' into master push 27 Aug 2026 09:25PM UTC web-flow github
82.61
30870374728 master conn: add unified QueryResultContext for arbitrary SQL (#1) * conn: add unified QueryResultContext for arbitrary SQL A caller that receives arbitrary SQL (a proxy, a REPL) must classify each statement before executing it, because database/sql fo... push 04 Aug 2026 02:00AM UTC web-flow github
82.51
30870040810 unified-query conn: reject named params and fix scan types on the unified path Two divergences from the normal query path, both found in review. QueryResultContext accepted driver.NamedValue with Name set and bound it positionally. QueryContext and ExecContex... Pull #1 04 Aug 2026 01:53AM UTC morgo github
82.61
See All Builds (7)

Badge your Repo: mysql

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

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

Refresh
  • Settings
  • Repo on GitHub
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