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
When giving explicit timestamps in queries they must be single-quoted:
> select count(value) from cpu_idle where time >= '2015-08-25T20:00:00Z' and time <= '2015-08-25T21:00:00Z' group by time(10m)
name: cpu_idle
--------------
time count
2015-08-25T20:00:00Z 8
2015-08-25T20:10:00Z 144
2015-08-25T20:20:00Z 688
2015-08-25T20:30:00Z 688
2015-08-25T20:40:00Z 688
2015-08-25T20:50:00Z 680
2015-08-25T21:00:00Z 688
Double-quoting returns results as if there were no time restriction at all:
> select count(value) from cpu_idle where time > "2015-08-25T20:00:00Z" and time < "2015-08-25T21:00:00Z" group by time(10m)
name: cpu_idle
--------------
time count
1970-01-01T00:00:00Z 618464
> select count(value) from cpu_idle
name: cpu_idle
--------------
time count
1970-01-01T00:00:00Z 618464
The text was updated successfully, but these errors were encountered:
We should specifically return an error if we detected a literal (double quotes instead of single) and error with something like time literals need to be single quoted, not double quoted.
Per Paul, in a WHERE time clause, first try to parse the double-quoted value as a timestamp, not an identifier. If that fails fall back to parsing it as an identifier.
The reason for this problem is because the function that retrieves the time range doesn't send back an error when it finds an objectionable time comparison like was done here.
The function that needs to be changed is influxql.TimeRange(). I can probably do this one with #3290.
A bigger refactor of these functions is needed to support #3290, but
this will work for the more common case that someone uses double quotes
instead of single quotes when surrounding a time literal.
Fixes#3932.
A bigger refactor of these functions is needed to support #3290, but
this will work for the more common case that someone uses double quotes
instead of single quotes when surrounding a time literal.
Fixes#3932.
When giving explicit timestamps in queries they must be single-quoted:
Double-quoting returns results as if there were no time restriction at all:
The text was updated successfully, but these errors were encountered: