fix: descending array cursor should include end time
Fixes https://github.com/influxdata/influxdb/issues/18897.pull/18905/head
parent
e6e55038e8
commit
49bdad8681
|
@ -293,9 +293,11 @@ func (c *floatArrayDescendingCursor) Next() *cursors.FloatArray {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pos > 0 && c.res.Timestamps[pos-1] <= c.end {
|
// If the earliest timestamp is strictly earlier than
|
||||||
|
// the end time, remove it from the result and repeat.
|
||||||
|
if pos > 0 && c.res.Timestamps[pos-1] < c.end {
|
||||||
pos -= 2
|
pos -= 2
|
||||||
for pos >= 0 && c.res.Timestamps[pos] <= c.end {
|
for pos >= 0 && c.res.Timestamps[pos] < c.end {
|
||||||
pos--
|
pos--
|
||||||
}
|
}
|
||||||
pos++
|
pos++
|
||||||
|
@ -603,9 +605,11 @@ func (c *integerArrayDescendingCursor) Next() *cursors.IntegerArray {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pos > 0 && c.res.Timestamps[pos-1] <= c.end {
|
// If the earliest timestamp is strictly earlier than
|
||||||
|
// the end time, remove it from the result and repeat.
|
||||||
|
if pos > 0 && c.res.Timestamps[pos-1] < c.end {
|
||||||
pos -= 2
|
pos -= 2
|
||||||
for pos >= 0 && c.res.Timestamps[pos] <= c.end {
|
for pos >= 0 && c.res.Timestamps[pos] < c.end {
|
||||||
pos--
|
pos--
|
||||||
}
|
}
|
||||||
pos++
|
pos++
|
||||||
|
@ -913,9 +917,11 @@ func (c *unsignedArrayDescendingCursor) Next() *cursors.UnsignedArray {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pos > 0 && c.res.Timestamps[pos-1] <= c.end {
|
// If the earliest timestamp is strictly earlier than
|
||||||
|
// the end time, remove it from the result and repeat.
|
||||||
|
if pos > 0 && c.res.Timestamps[pos-1] < c.end {
|
||||||
pos -= 2
|
pos -= 2
|
||||||
for pos >= 0 && c.res.Timestamps[pos] <= c.end {
|
for pos >= 0 && c.res.Timestamps[pos] < c.end {
|
||||||
pos--
|
pos--
|
||||||
}
|
}
|
||||||
pos++
|
pos++
|
||||||
|
@ -1225,9 +1231,11 @@ func (c *stringArrayDescendingCursor) Next() *cursors.StringArray {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pos > 0 && c.res.Timestamps[pos-1] <= c.end {
|
// If the earliest timestamp is strictly earlier than
|
||||||
|
// the end time, remove it from the result and repeat.
|
||||||
|
if pos > 0 && c.res.Timestamps[pos-1] < c.end {
|
||||||
pos -= 2
|
pos -= 2
|
||||||
for pos >= 0 && c.res.Timestamps[pos] <= c.end {
|
for pos >= 0 && c.res.Timestamps[pos] < c.end {
|
||||||
pos--
|
pos--
|
||||||
}
|
}
|
||||||
pos++
|
pos++
|
||||||
|
@ -1537,9 +1545,11 @@ func (c *booleanArrayDescendingCursor) Next() *cursors.BooleanArray {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pos > 0 && c.res.Timestamps[pos-1] <= c.end {
|
// If the earliest timestamp is strictly earlier than
|
||||||
|
// the end time, remove it from the result and repeat.
|
||||||
|
if pos > 0 && c.res.Timestamps[pos-1] < c.end {
|
||||||
pos -= 2
|
pos -= 2
|
||||||
for pos >= 0 && c.res.Timestamps[pos] <= c.end {
|
for pos >= 0 && c.res.Timestamps[pos] < c.end {
|
||||||
pos--
|
pos--
|
||||||
}
|
}
|
||||||
pos++
|
pos++
|
||||||
|
|
|
@ -300,9 +300,11 @@ func (c *{{$type}}) Next() {{$arrayType}} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pos > 0 && c.res.Timestamps[pos-1] <= c.end {
|
// If the earliest timestamp is strictly earlier than
|
||||||
|
// the end time, remove it from the result and repeat.
|
||||||
|
if pos > 0 && c.res.Timestamps[pos-1] < c.end {
|
||||||
pos -= 2
|
pos -= 2
|
||||||
for pos >= 0 && c.res.Timestamps[pos] <= c.end {
|
for pos >= 0 && c.res.Timestamps[pos] < c.end {
|
||||||
pos--
|
pos--
|
||||||
}
|
}
|
||||||
pos++
|
pos++
|
||||||
|
|
Loading…
Reference in New Issue