From 1a3b0a731a9d2b66fb058caef95c004634b17307 Mon Sep 17 00:00:00 2001 From: Jan Mercl <0xjnml@gmail.com> Date: Mon, 22 May 2017 14:58:44 +0200 Subject: Add bug reproduction test. Updates #11. modified: all_test.go --- all_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'all_test.go') diff --git a/all_test.go b/all_test.go index 6a060eb..34f5349 100644 --- a/all_test.go +++ b/all_test.go @@ -464,3 +464,31 @@ func BenchmarkNextMemory(b *testing.B) { d := time.Since(t0) profile(b, d, os.Stderr, "==== BenchmarkNextMemory b.N %v\n", b.N) } + +// https://github.com/cznic/sqlite/issues/11 +func TestIssue11(t *testing.T) { + const N = 6570 + dir, db := tempDB(t) + + defer func() { + db.Close() + os.RemoveAll(dir) + }() + + if _, err := db.Exec(` + CREATE TABLE t1 (t INT); + BEGIN; +`, + ); err != nil { + panic(err) + } + + for i := 0; i < N; i++ { + if _, err := db.Exec("INSERT INTO t1 (t) VALUES (?)", i); err != nil { + t.Fatalf("#%v: %v", i, err) + } + } + if _, err := db.Exec("COMMIT;"); err != nil { + t.Fatal(err) + } +} -- cgit v1.2.3-70-g09d2