Skip to content

Commit

Permalink
test unset temp flag for ART
Browse files Browse the repository at this point in the history
Signed-off-by: you06 <[email protected]>
  • Loading branch information
you06 committed Sep 24, 2024
1 parent 49668b4 commit e2b8216
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 1 addition & 4 deletions internal/unionstore/memdb_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ func BenchmarkMemDbIter(b *testing.B) {
}

b.Run("RBT", func(b *testing.B) { fn(b, newRbtDBWithContext()) })
b.Run("ART", func(b *testing.B) {
b.Skip("unimplemented")
fn(b, newArtDBWithContext())
})
b.Run("ART", func(b *testing.B) { fn(b, newArtDBWithContext()) })
}

func BenchmarkMemDbCreation(b *testing.B) {
Expand Down
12 changes: 8 additions & 4 deletions internal/unionstore/memdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -978,13 +978,17 @@ func testBufferLimit(t *testing.T, buffer MemBuffer) {
}

func TestUnsetTemporaryFlag(t *testing.T) {
testUnsetTemporaryFlag(t, newRbtDBWithContext())
testUnsetTemporaryFlag(t, newArtDBWithContext())
}

func testUnsetTemporaryFlag(t *testing.T, buffer MemBuffer) {
require := require.New(t)
db := NewMemDB()
key := []byte{1}
value := []byte{2}
db.SetWithFlags(key, value, kv.SetNeedConstraintCheckInPrewrite)
db.Set(key, value)
flags, err := db.GetFlags(key)
buffer.SetWithFlags(key, value, kv.SetNeedConstraintCheckInPrewrite)
buffer.Set(key, value)
flags, err := buffer.GetFlags(key)
require.Nil(err)
require.False(flags.HasNeedConstraintCheckInPrewrite())
}
Expand Down

0 comments on commit e2b8216

Please sign in to comment.