Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'true' and 'false' quietly (?) removed/broken in InfluxDB 1.4.x #9226

Closed
davidgubler opened this issue Dec 14, 2017 · 3 comments
Closed

'true' and 'false' quietly (?) removed/broken in InfluxDB 1.4.x #9226

davidgubler opened this issue Dec 14, 2017 · 3 comments

Comments

@davidgubler
Copy link

Bug report

System info: InfluxDB 1.4.2 on Ubuntu 16.04

Steps to reproduce:

This query used to work on InfluxDB 1.3.7:
SELECT * FROM aggregate.aggregate_project WHERE true AND (false OR product = 'fooproduct:v1') AND time >= 1510614000000000000

On InfluxDB 1.4.2, I get:
ERR: invalid condition expression: true
If I remove the 'true AND', I get:
ERR: invalid condition expression: false
If I remove the 'false OR', the query works.

Either the 'true' and 'false' was removed from InfluxDB 1.4.x, or it is broken. I could not find any documentation about this.

In case you are wondering: I am assembling the queries programmatically. There are cases where it is much simpler to just add 'true' or 'false', because then the rest of the query can remain the same.
E.g.:
SELECT * FROM aggregate.aggregate_project WHERE customer='foo' AND (false OR product = 'fooproduct:v1') AND time >= 1510614000000000000
Now I want the same query, but I don't care about the customer. So I insert 'true' instead and therefore I can leave the rest of the query the same.
SELECT * FROM aggregate.aggregate_project WHERE true AND (false OR product = 'fooproduct:v1') AND time >= 1510614000000000000
Such an approach works fine in pretty much all other databases, therefore I expect InfluxDB 1.4.x+ to support this, too, especially since it worked in 1.3.x.

@jsternberg
Copy link
Contributor

@rbetts the fix for this will likely need a backport.

@prokod
Copy link

prokod commented Jan 5, 2018

Hi, Any estimates on when it will be available for 1.4.x as an updated rpm ?

@prokod
Copy link

prokod commented Jan 5, 2018

Hi @jsternberg I have compiled influx from latest branch 1.4 (commit 0dac738) which includes this bug fix and even though,
when querying:
SELECT * from cs_daily_prg_global WHERE time >= 1514419200000000000
I get a result set with some data points returned as expected.
when querying:
SELECT * from cs_daily_prg_global WHERE time >= 1514419200000000000 AND true
I get empty result set. I would expect it will return the same set as above.
when querying:
SELECT * from cs_daily_prg_global WHERE time >= 1514419200000000000 AND 1 = 1
I get ERR: invalid condition expression. I would expect 1 = 1 to be reduced to true

In case you are wondering: We have created numerous Grafana dashboards based on Influx DB 1.2/3 and we have used this literal binary expression evaluation within InfluxQL to reduce the amount of queries needed for each Grafana Panel when using multiple template variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants