You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> CREATE DATABASE db0
> USE db0
> INSERT cpu,host=server01 value=2 1000000000
> INSERT cpu,host=server01 value=3 2000000000
> INSERT cpu,host=server02 value=4 1000000000
> INSERT cpu,host=server02 value=5 2000000000
> SELECT value, host FROM cpu ORDER BY time DESC
name: cpu
time value host
---- ----- ----
2000000000 3 server01
2000000000 5 server02
1000000000 2 server01
1000000000 4 server02
The order should be server02 before server01. There is also an error in the Emitter which causes this one:
> CREATE DATABASE db0
> USE db0
> INSERT mem,host=server01 free=1 1000000000
> INSERT mem,host=server01 free=2 2000000000
> INSERT mem,host=server02 used=3 1000000000
> INSERT mem,host=server02 used=4 2000000000
> SELECT first("used") AS "used", first("free") AS "free" FROM "mem" WHERE time >= '1970-01-01T00:00:01Z' AND time <= '1970-01-01T00:00:02Z' GROUP BY host, time(1s) FILL(none) ORDER BY time DESC
name: mem
tags: host=server01
time used free
---- ---- ----
2000000000 2
1000000000 1
name: mem
tags: host=server02
time used free
---- ---- ----
2000000000 4
1000000000 3
server02 is supposed to be before server01.
Additional info:
This section of code seems wrong and an earlier version of the code seems to do something different:
// Update range values if lower and emitter is in time ascending order.
if e.ascending {
if (itrName < name) || (itrName == name && itrTags.ID() < tags.ID()) || (itrName == name && itrTags.ID() == tags.ID() && itrTime < t) {
t, name, tags = itrTime, itrName, itrTags
}
continue
}
// Update range values if higher and emitter is in time descending order.
if (itrName < name) || (itrName == name && itrTags.ID() < tags.ID()) || (itrName == name && itrTags.ID() == tags.ID() && itrTime < t) {
t, name, tags = itrTime, itrName, itrTags
}
It seems like the second statement there have the conditions in the wrong direction.
The text was updated successfully, but these errors were encountered:
jsternberg
changed the title
GROUP BY time DESC probably returns the wrong results sometimes
ORDER BY time DESC probably returns the wrong results sometimes
Jan 30, 2017
Bug report
System info: InfluxDB 1.2.0
Steps to reproduce:
The order should be
server02
beforeserver01
. There is also an error in the Emitter which causes this one:server02
is supposed to be beforeserver01
.Additional info:
This section of code seems wrong and an earlier version of the code seems to do something different:
It seems like the second statement there have the conditions in the wrong direction.
The text was updated successfully, but these errors were encountered: