mirror of
https://github.com/glebarez/go-sqlite.git
synced 2025-10-04 23:42:40 +08:00
add TestIssue70, updates #70
This commit is contained in:
23
all_test.go
23
all_test.go
@@ -1792,3 +1792,26 @@ func emptyDir(s string) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://gitlab.com/cznic/sqlite/-/issues/70
|
||||||
|
func TestIssue70(t *testing.T) {
|
||||||
|
db, err := sql.Open(driverName, "file::memory:")
|
||||||
|
if _, err = db.Exec(`create table t (foo)`); err != nil {
|
||||||
|
t.Fatalf("create: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
if err := db.Close(); err != nil {
|
||||||
|
t.Errorf("close: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
if _, err := db.Query("select * from t"); err != nil {
|
||||||
|
t.Errorf("select a: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := db.Query("select * from t"); err != nil {
|
||||||
|
t.Errorf("select b: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user