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

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

Build:
Build:
LAST BUILD BRANCH: add-github-actions
DEFAULT BRANCH: master
Ran 18 Jul 2018 01:06AM UTC
Jobs 16
Files 10
Run time 17min
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
808

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.

2 of 2 new or added lines in 1 file covered. (100.0%)

952 of 1643 relevant lines covered (57.94%)

1385102.29 hits per line

Jobs
ID Job ID Ran Files Coverage
1 808.1 (GOTAGS=) 18 Jul 2018 01:06AM UTC 0
58.28
Travis Job 808.1
2 808.2 (GOTAGS=libsqlite3) 18 Jul 2018 01:06AM UTC 0
58.28
Travis Job 808.2
3 808.3 (GOTAGS="sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable") 18 Jul 2018 01:06AM UTC 0
58.28
Travis Job 808.3
4 808.4 (GOTAGS=sqlite_vacuum_full) 18 Jul 2018 01:07AM UTC 0
58.28
Travis Job 808.4
5 808.5 (GOTAGS=) 18 Jul 2018 01:07AM UTC 0
58.28
Travis Job 808.5
6 808.6 (GOTAGS=libsqlite3) 18 Jul 2018 01:12AM UTC 0
58.28
Travis Job 808.6
7 808.7 (GOTAGS="sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable") 18 Jul 2018 01:13AM UTC 0
58.28
Travis Job 808.7
8 808.8 (GOTAGS=sqlite_vacuum_full) 18 Jul 2018 01:14AM UTC 0
58.28
Travis Job 808.8
9 808.9 (GOTAGS=) 18 Jul 2018 01:12AM UTC 0
57.84
Travis Job 808.9
10 808.10 (GOTAGS=libsqlite3) 18 Jul 2018 01:12AM UTC 0
57.84
Travis Job 808.10
11 808.11 (GOTAGS="sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable") 18 Jul 2018 01:16AM UTC 0
57.84
Travis Job 808.11
12 808.12 (GOTAGS=sqlite_vacuum_full) 18 Jul 2018 01:17AM UTC 0
57.84
Travis Job 808.12
13 808.13 (GOTAGS=) 18 Jul 2018 01:18AM UTC 0
57.84
Travis Job 808.13
14 808.14 (GOTAGS=libsqlite3) 18 Jul 2018 01:19AM UTC 0
57.84
Travis Job 808.14
15 808.15 (GOTAGS="sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable") 18 Jul 2018 01:21AM UTC 0
57.84
Travis Job 808.15
16 808.16 (GOTAGS=sqlite_vacuum_full) 18 Jul 2018 01:23AM UTC 0
57.84
Travis Job 808.16
Source Files on build 808
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #808
  • Pull Request #608
  • PR Base - master (#800)
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