mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
fix integer bug on less than queries.
this was introduced recently to fix another bug. the comment above it is correct, just the logic was off-by-one. The test shows the issue and was confirmed to reproduce it and then fix it.
This commit is contained in:
parent
7401fd1333
commit
0fec16a141
2 changed files with 18 additions and 1 deletions
|
|
@ -1175,7 +1175,8 @@ func (f *fragment) rangeLTUnsigned(filter *Row, bitDepth uint, predicate uint64,
|
|||
|
||||
// if the predicate is larger than all representable numbers given
|
||||
// our bitDepth... then just return everything.
|
||||
if msb(predicate) >= bitDepth {
|
||||
if msb(predicate) > bitDepth {
|
||||
|
||||
return filter, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3243,6 +3243,22 @@ func TestFragmentPositionsForValue(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestIntLTRegression(t *testing.T) {
|
||||
f := mustOpenFragment("i", "f", "v", 0, CacheTypeNone)
|
||||
defer f.Clean(t)
|
||||
|
||||
f.setValue(1, 6, 33)
|
||||
|
||||
row, err := f.rangeOp(pql.LT, 6, 33)
|
||||
if err != nil {
|
||||
t.Fatalf("doing range of: %v", err)
|
||||
}
|
||||
|
||||
if !row.IsEmpty() {
|
||||
t.Errorf("expected nothing, but got: %v", row.Columns())
|
||||
}
|
||||
}
|
||||
|
||||
func TestImportClearRestart(t *testing.T) {
|
||||
tests := []struct {
|
||||
rows []uint64
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue