Skip to content

influxql: invalid duration literals parsed successfully and treated as 0s #8181

Closed
@mark-rushakoff

Description

@mark-rushakoff

With the NOAA data:

> select * from h2o_feet where time > now() - 10000d limit 3
name: h2o_feet
time                level description    location     water_level
----                -----------------    --------     -----------
1439856000000000000 between 6 and 9 feet coyote_creek 8.12
1439856000000000000 below 3 feet         santa_monica 2.064
1439856360000000000 between 6 and 9 feet coyote_creek 8.005

> select * from h2o_feet where time > now() - 10000w limit 3
name: h2o_feet
time                level description    location     water_level
----                -----------------    --------     -----------
1439856000000000000 between 6 and 9 feet coyote_creek 8.12
1439856000000000000 below 3 feet         santa_monica 2.064
1439856360000000000 between 6 and 9 feet coyote_creek 8.005

> select * from h2o_feet where time > now() - 10000y limit 3
> select * from h2o_feet where time > now() - 10000asdf limit 3
> select * from h2o_feet where time > now() - asdf limit 3
ERR: invalid operation: time and *influxql.BinaryExpr are not compatible

The y suffix is something that people are likely to try, even though it's not a supported unit.

Both the y and asdf (and any other suffix that isn't a valid unit) show up in the query log as parsed as 0s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      influxql: invalid duration literals parsed successfully and treated as 0s · Issue #8181 · influxdata/influxdb