diff options
author | Philip O'Toole <philip.otoole@yahoo.com> | 2018-08-30 05:44:58 -0700 |
---|---|---|
committer | Philip O'Toole <philip.otoole@yahoo.com> | 2018-08-30 05:47:34 -0700 |
commit | abfacf568407f0fa384f75cac134b4ebd9cf33ec (patch) | |
tree | b5687d3f1683c3931c501d2449b2d258d0999877 | |
parent | Merge pull request #621 from AndrewMurrell/master (diff) | |
download | golite-abfacf568407f0fa384f75cac134b4ebd9cf33ec.tar.gz golite-abfacf568407f0fa384f75cac134b4ebd9cf33ec.tar.xz |
Fix data race in AutoCommit()
Detected via https://circleci.com/gh/rqlite/rqlite/2223.
-rw-r--r-- | sqlite3.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -648,6 +648,8 @@ func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool // AutoCommit return which currently auto commit or not. func (c *SQLiteConn) AutoCommit() bool { + c.mu.Lock() + defer c.mu.Unlock() return int(C.sqlite3_get_autocommit(c.db)) != 0 } |