Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Apr 27, 2024
1 parent 85a4e0e commit b428450
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions mdbx/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,34 +419,14 @@ func TestTxn_OpenDBI_emptyName(t *testing.T) {
}

func TestTxn_OpenDBI_zero(t *testing.T) {
env, err := NewEnv()
if err != nil {
t.Fatalf("env: %s", err)
}
path := t.TempDir()
err = env.SetOption(OptMaxDB, 1024)
if err != nil {
t.Fatalf("setmaxdbs: %v", err)
}
const pageSize = 4096
err = env.SetGeometry(-1, -1, 64*1024*pageSize, -1, -1, pageSize)
if err != nil {
t.Fatalf("setmaxdbs: %v", err)
}
err = env.Open(path, 0, 0664)
if err != nil {
t.Fatalf("open: %s", err)
}
t.Cleanup(func() {
env.Close()
})
env, _ := setup(t)

err = env.View(func(txn *Txn) (err error) {
_, err = txn.OpenRoot(0)
err := env.View(func(txn *Txn) (err error) {
dbi, err := txn.OpenRoot(0)
if err != nil {
return err
}
_, err = txn.Get(0, []byte("k"))
_, err = txn.Get(dbi, []byte("k"))
return err
})
if !IsErrno(err, BadDBI) {
Expand Down

0 comments on commit b428450

Please sign in to comment.