1
0
Fork 0

Check for nil row from Execer

master
Philip O Toole 8 years ago
parent 21ae24d8d8
commit b0e7432dc3

@ -1,3 +1,6 @@
## 3.9.2 (unreleased)
- [PR #253](https://github.com/rqlite/rqlite/pull/254): Handle nil row returned by SQL execer. Fixes [issue #253](https://github.com/rqlite/rqlite/issues/253).
## 3.9.1 (December 29th 2016)
- [PR #247](https://github.com/rqlite/rqlite/pull/247): Simplify loading of SQLite dump files via single command execution. Fixes [issue #246](https://github.com/rqlite/rqlite/issues/246).
- [PR #247](https://github.com/rqlite/rqlite/pull/247): Correct SQLite dump load authentication check.

@ -247,6 +247,9 @@ func (db *DB) Execute(queries []string, tx, xTime bool) ([]*Result, error) {
}
break
}
if r == nil {
continue
}
lid, err := r.LastInsertId()
if err != nil {

@ -82,6 +82,21 @@ func Test_LoadInMemory(t *testing.T) {
}
}
func Test_EmptyStatements(t *testing.T) {
db, path := mustCreateDatabase()
defer db.Close()
defer os.Remove(path)
_, err := db.Execute([]string{""}, false, false)
if err != nil {
t.Fatalf("failed to execute empty statement: %s", err.Error())
}
_, err = db.Execute([]string{";"}, false, false)
if err != nil {
t.Fatalf("failed to execute empty statement with semicolon: %s", err.Error())
}
}
func Test_SimpleSingleStatements(t *testing.T) {
db, path := mustCreateDatabase()
defer db.Close()

Loading…
Cancel
Save