Commit 96a298b9 authored by gwenn's avatar gwenn

Try to fix Travis build.

parent f5bd5897
...@@ -9,7 +9,6 @@ before_install: ...@@ -9,7 +9,6 @@ before_install:
before_script: before_script:
- go get github.com/bmizerany/assert - go get github.com/bmizerany/assert
- go get code.google.com/p/go.tools/cmd/cover - go get code.google.com/p/go.tools/cmd/cover
- go get github.com/sauerbraten/radix
- go get -tags all github.com/gwenn/gosqlite - go get -tags all github.com/gwenn/gosqlite
script: script:
- go test -tags all -cover ./... - go test -tags all -cover ./...
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build ignore
package shell_test package shell_test
import ( import (
......
...@@ -529,19 +529,23 @@ func (c *Conn) Close() error { ...@@ -529,19 +529,23 @@ func (c *Conn) Close() error {
c.stmtCache.flush() c.stmtCache.flush()
// Dangling statements rv := C.sqlite3_close(c.db)
stmt := C.sqlite3_next_stmt(c.db, nil)
for stmt != nil { if rv == C.SQLITE_BUSY {
if C.sqlite3_stmt_busy(stmt) != 0 { // Dangling statements
Log(C.SQLITE_MISUSE, "Dangling statement (not reset): \""+C.GoString(C.sqlite3_sql(stmt))+"\"") stmt := C.sqlite3_next_stmt(c.db, nil)
} else { for stmt != nil {
Log(C.SQLITE_MISUSE, "Dangling statement (not finalize): \""+C.GoString(C.sqlite3_sql(stmt))+"\"") if C.sqlite3_stmt_busy(stmt) != 0 {
Log(C.SQLITE_MISUSE, "Dangling statement (not reset): \""+C.GoString(C.sqlite3_sql(stmt))+"\"")
} else {
Log(C.SQLITE_MISUSE, "Dangling statement (not finalize): \""+C.GoString(C.sqlite3_sql(stmt))+"\"")
}
C.sqlite3_finalize(stmt)
stmt = C.sqlite3_next_stmt(c.db, nil)
} }
//C.sqlite3_finalize(stmt) rv = C.sqlite3_close(c.db)
stmt = C.sqlite3_next_stmt(c.db, stmt)
} }
rv := C.sqlite3_close(c.db)
if rv != C.SQLITE_OK { if rv != C.SQLITE_OK {
Log(int32(rv), "error while closing Conn") Log(int32(rv), "error while closing Conn")
return c.error(rv, "Conn.Close") return c.error(rv, "Conn.Close")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment