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

go-sql-driver / mysql / 1146
83%

Build:
DEFAULT BRANCH: master
Ran 22 Aug 2017 09:49PM UTC
Jobs 8
Files 16
Run time 2min
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

pending completion
1146

push

travis-ci

web-flow
fewer driver.ErrBadConn to prevent repeated queries (#302)

According to the database/sql/driver documentation, ErrBadConn should only
be used when the database was not affected. The driver restarts the same
query on a different connection, then.
The mysql driver did not follow this advice, so queries were repeated if
ErrBadConn is returned but a query succeeded.

This is fixed by changing most ErrBadConn errors to ErrInvalidConn.

The only valid returns of ErrBadConn are at the beginning of a database
interaction when no data was sent to the database yet.

Those valid cases are located the following funcs before attempting to write
to the network or if 0 bytes were written:

* Begin
* BeginTx
* Exec
* ExecContext
* Prepare
* PrepareContext
* Query
* QueryContext

Commit and Rollback could arguably also be on that list, but are left out as
some engines like MyISAM are not supporting transactions.

Tests in b/packets_test.go were changed because they simulate a read not
preceded by a write to the db. This cannot happen as the client has to send
the query first.

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

2295 of 3019 relevant lines covered (76.02%)

281203.47 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
100.0
statement.go
7
100.0
connection.go
14
100.0
packets.go
Jobs
ID Job ID Ran Files Coverage
1 1146.1 22 Aug 2017 09:49PM UTC 0
72.59
Travis Job 1146.1
2 1146.2 22 Aug 2017 09:49PM UTC 0
72.59
Travis Job 1146.2
3 1146.3 22 Aug 2017 09:49PM UTC 0
72.79
Travis Job 1146.3
4 1146.4 22 Aug 2017 09:50PM UTC 0
74.54
Travis Job 1146.4
5 1146.5 22 Aug 2017 09:50PM UTC 0
74.54
Travis Job 1146.5
6 1146.6 (DB=MYSQL57) 22 Aug 2017 09:51PM UTC 0
75.21
Travis Job 1146.6
7 1146.7 (DB=MARIA55) 22 Aug 2017 09:51PM UTC 0
74.47
Travis Job 1146.7
8 1146.8 (DB=MARIA10_1) 22 Aug 2017 09:51PM UTC 0
75.01
Travis Job 1146.8
Source Files on build 1146
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1146
  • 26471af1 on github
  • Prev Build on master (#1144)
  • Next Build on master (#1156)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc