Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/unionstore/art/art_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,9 @@ func TestDiscardValues(t *testing.T) {
tree.Set([]byte{3}, []byte{4})
})
}

func TestKeyFlagsBoundary(t *testing.T) {
require.LessOrEqual(t, kv.FlagMaxBit, deleteFlag)
validMaxFlag := kv.FlagMaxBit - 1
require.Equal(t, validMaxFlag&kv.KeyFlags(flagMask), validMaxFlag)
}
5 changes: 5 additions & 0 deletions kv/keyflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ const (
// ends when the lock is acquired.
flagPreviousPresumeKNE

// FlagMaxBit is a sentinel value to indicate the maximum bit of KeyFlags.
// Important: add your flag before it, and the FlagMaxBit should always be the last one.
// It's used to avoid setting flags on the highest bit of KeyFlags.
FlagMaxBit

persistentFlags = flagKeyLocked | flagKeyLockedValExist | flagNeedConstraintCheckInPrewrite
)

Expand Down
Loading