mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
add bounds check when getting time rows
This commit is contained in:
parent
ff153459ee
commit
2c311e685e
2 changed files with 7 additions and 0 deletions
|
|
@ -1521,6 +1521,11 @@ func (e *executor) executeRowShard(ctx context.Context, index string, c *pql.Cal
|
|||
}
|
||||
rows = append(rows, f.row(rowID))
|
||||
}
|
||||
if len(rows) == 0 {
|
||||
return &Row{}, nil
|
||||
} else if len(rows) == 1 {
|
||||
return rows[0], nil
|
||||
}
|
||||
row := rows[0].Union(rows[1:]...)
|
||||
f.Stats.Count("range", 1, 1.0)
|
||||
return row, nil
|
||||
|
|
|
|||
|
|
@ -3292,6 +3292,7 @@ func TestExecutor_Execute_RowsTime(t *testing.T) {
|
|||
`Rows(f)`,
|
||||
`Rows(f, from=2002-01-01T00:00)`,
|
||||
`Rows(f, to=2003-02-03T00:00)`,
|
||||
`Rows(f, from=2002-01-01T00:00, to=2002-01-02T00:00)`,
|
||||
}
|
||||
expResults := [][]uint64{
|
||||
{1},
|
||||
|
|
@ -3300,6 +3301,7 @@ func TestExecutor_Execute_RowsTime(t *testing.T) {
|
|||
{1, 2, 3, 4, 13},
|
||||
{2, 3, 4, 13},
|
||||
{1, 2, 3, 13},
|
||||
{2},
|
||||
}
|
||||
|
||||
responses := runCallTest(t, writeQuery, readQueries,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue