mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
check range with CacheTypeNone
This commit is contained in:
parent
2cfcf497e1
commit
4aa487daac
2 changed files with 13 additions and 2 deletions
3
index.go
3
index.go
|
|
@ -394,10 +394,9 @@ func (i *Index) createFrame(name string, opt FrameOptions) (*Frame, error) {
|
|||
if opt.RangeEnabled {
|
||||
if opt.InverseEnabled {
|
||||
return nil, ErrInverseRangeNotAllowed
|
||||
} else if opt.CacheType != "" && opt.CacheType != CacheTypeLRU {
|
||||
} else if opt.CacheType != "" && opt.CacheType != CacheTypeNone {
|
||||
return nil, ErrRangeCacheNotAllowed
|
||||
}
|
||||
opt.CacheSize = 0
|
||||
} else {
|
||||
if len(opt.Fields) > 0 {
|
||||
return nil, ErrFrameFieldsNotAllowed
|
||||
|
|
|
|||
|
|
@ -149,6 +149,18 @@ func TestIndex_CreateFrame(t *testing.T) {
|
|||
}
|
||||
})
|
||||
|
||||
t.Run("RangeEnabledWithCacheTypeNone", func(t *testing.T) {
|
||||
index := test.MustOpenIndex()
|
||||
defer index.Close()
|
||||
if _, err := index.CreateFrame("f", pilosa.FrameOptions{
|
||||
RangeEnabled: true,
|
||||
CacheType: pilosa.CacheTypeNone,
|
||||
CacheSize: uint32(5),
|
||||
}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("ErrFrameFieldsNotAllowed", func(t *testing.T) {
|
||||
index := test.MustOpenIndex()
|
||||
defer index.Close()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue