From ba4840c52becf73c2749c9ef0f2f09ed0b9d5c7f Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Sun, 12 Feb 2017 22:24:33 +0000 Subject: Update dependencies --- vendor/github.com/mattn/go-sqlite3/README.md | 17 +++++++++++++---- vendor/github.com/mattn/go-sqlite3/doc.go | 2 -- vendor/github.com/mattn/go-sqlite3/sqlite3.go | 19 ++++++++++++------- vendor/github.com/mattn/go-sqlite3/tracecallback.go | 1 - .../mattn/go-sqlite3/tracecallback_noimpl.go | 10 ---------- 5 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go (limited to 'vendor/github.com/mattn') diff --git a/vendor/github.com/mattn/go-sqlite3/README.md b/vendor/github.com/mattn/go-sqlite3/README.md index a875e31..825d3aa 100644 --- a/vendor/github.com/mattn/go-sqlite3/README.md +++ b/vendor/github.com/mattn/go-sqlite3/README.md @@ -48,16 +48,16 @@ FAQ * Can't build go-sqlite3 on windows 64bit. > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit. - > See: https://github.com/mattn/go-sqlite3/issues/27 + > See: [#27](https://github.com/mattn/go-sqlite3/issues/27) * Getting insert error while query is opened. > You can pass some arguments into the connection string, for example, a URI. - > See: https://github.com/mattn/go-sqlite3/issues/39 + > See: [#39](https://github.com/mattn/go-sqlite3/issues/39) * Do you want to cross compile? mingw on Linux or Mac? - > See: https://github.com/mattn/go-sqlite3/issues/106 + > See: [#106](https://github.com/mattn/go-sqlite3/issues/106) > See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html * Want to get time.Time with current locale @@ -66,7 +66,16 @@ FAQ * Can use this in multiple routines concurrently? - Yes for readonly. But, No for writable. See #50, #51, #209. + Yes for readonly. But, No for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209). + +* Why is it racy if I use a `sql.Open("sqlite", ":memory:")` database? + + Each connection to :memory: opens a brand new in-memory sql database, so if + the stdlib's sql engine happens to open another connection and you've only + specified ":memory:", that connection will see a brand new database. A + workaround is to use "file::memory:?mode=memory&cache=shared". Every + connection to this string will point to the same in-memory database. See + [#204](https://github.com/mattn/go-sqlite3/issues/204) for more info. License ------- diff --git a/vendor/github.com/mattn/go-sqlite3/doc.go b/vendor/github.com/mattn/go-sqlite3/doc.go index 030cd93..c721f77 100644 --- a/vendor/github.com/mattn/go-sqlite3/doc.go +++ b/vendor/github.com/mattn/go-sqlite3/doc.go @@ -110,5 +110,3 @@ See the documentation of RegisterFunc for more details. */ package sqlite3 - -import "C" diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3.go b/vendor/github.com/mattn/go-sqlite3/sqlite3.go index 64933f1..f5699e4 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3.go @@ -429,6 +429,7 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []namedValue) if s.(*SQLiteStmt).s != nil { na := s.NumInput() if len(args) < na { + s.Close() return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args)) } for i := 0; i < na; i++ { @@ -765,14 +766,18 @@ func (s *SQLiteStmt) query(ctx context.Context, args []namedValue) (driver.Rows, done: make(chan struct{}), } - go func() { + go func(db *C.sqlite3) { select { case <-ctx.Done(): - C.sqlite3_interrupt(s.c.db) - rows.Close() + select { + case <-rows.done: + default: + C.sqlite3_interrupt(s.c.db) + rows.Close() + } case <-rows.done: } - }() + }(s.c.db) return rows, nil } @@ -808,13 +813,13 @@ func (s *SQLiteStmt) exec(ctx context.Context, args []namedValue) (driver.Result done := make(chan struct{}) defer close(done) - go func() { + go func(db *C.sqlite3) { select { case <-ctx.Done(): - C.sqlite3_interrupt(s.c.db) + C.sqlite3_interrupt(db) case <-done: } - }() + }(s.c.db) var rowid, changes C.longlong rv := C._sqlite3_step(s.s, &rowid, &changes) diff --git a/vendor/github.com/mattn/go-sqlite3/tracecallback.go b/vendor/github.com/mattn/go-sqlite3/tracecallback.go index 93688d4..de1d504 100644 --- a/vendor/github.com/mattn/go-sqlite3/tracecallback.go +++ b/vendor/github.com/mattn/go-sqlite3/tracecallback.go @@ -1,5 +1,4 @@ // Copyright (C) 2016 Yasuhiro Matsumoto . -// TODO: add "Gimpl do foo" team? // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go b/vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go deleted file mode 100644 index f270415..0000000 --- a/vendor/github.com/mattn/go-sqlite3/tracecallback_noimpl.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build !trace - -package sqlite3 - -import "errors" - -// RegisterAggregator register the aggregator. -func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool) error { - return errors.New("This feature is not implemented") -} -- cgit v1.2.3