Merge pull request #626 from otoolep/fix_data_race

Fix data race in AutoCommit()
This commit is contained in:
mattn
2018-11-22 01:49:42 +09:00
committed by GitHub

View File

@@ -740,6 +740,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
}