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

mattn / go-sqlite3 / 808 / 14
58%
master: 54%

Build:
Build:
LAST BUILD BRANCH: add-github-actions
DEFAULT BRANCH: master
Ran 18 Jul 2018 01:19AM UTC
Files 10
Run time 1s
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

18 Jul 2018 01:02AM UTC coverage: 57.84% (-0.4%) from 58.275%
GOTAGS=libsqlite3

Pull #608

travis-ci

web-flow
Ensure that SqliteStmt.closed property is guarded.

Because the closed property of the SQLiteRows's *SqliteStmt
was not guarded, it was causing an issue during context
cancellation.

https://github.com/segmentio/go-sqlite3/blob/<a class=hub.com/mattn/go-sqlite3/commit/be424d27acde822f080bdcd8a7ae6abd4d7d801e">be424d27a/sqlite3.go#L1785-L1796

When a statement is performing a query(), if it determines that
the context has been canceled, it will launch a goroutine that
closes the resulting driver.Rows if it's not already completed.

If the driver.Rows is not done (and the context has been canceled),
it will interrupt the connection and more importantly, perform
a rows.Close(). The method rows.Close() guards the closed bool with
a sync.Mutex to set it to true.

If a reader is reading from the SqliteRow, it will call Next()
and that performs this check:

https://github.com/segmentio/go-sqlite3/blob/be424d27acde822f080bdcd8a7ae6abd4d7d801e/sqlite3.go#L1915-L1917

Because this is not guarded, a data race ensues, and this was
actually caught by the Go race detector recently.

I didn't include a test case here because the fix seemed
straightforward enough and because race conditions are hard
to test for.  It's been verified in another program that this
fixes the issue.  If tests should be provided I'm more than
happy to do so.
Pull Request #608: Ensure that SqliteStmt.closed property is guarded.

948 of 1639 relevant lines covered (57.84%)

65381.18 hits per line

Source Files on job 808.14 (GOTAGS=libsqlite3)
  • Tree
  • List 0
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 854
  • Travis Job 808.14
  • df87430d on github
  • Prev Job for GOTAGS=libsqlite3 on fix-race-upstream (#800.2)
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

© 2026 Coveralls, Inc