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

Broken query logic if 'time' is used multiple times #9227

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

Broken query logic if 'time' is used multiple times #9227

davidgubler opened this issue Dec 14, 2017 · 2 comments

Comments

@davidgubler
Copy link

davidgubler commented Dec 14, 2017

Bug report

System info: InfluxDB 1.4.2 on Ubuntu 16.04

Steps to reproduce:

This query returns results:
SELECT * FROM aggregate.aggregate_project WHERE (product = 'fooproduct:v1') AND time >= 1510614000000000000

Now I add an OR condition which logically should have no impact on the query (sure, 'time < 1' is always false, but since it's part of an OR statement it should not change anything):
SELECT * FROM aggregate.aggregate_project WHERE (time < 1 OR product = 'fooproduct:v1') AND time >= 1510614000000000000

Now the query doesn't return any results anymore.

This is clearly a bug, since the database doesn't follow the logic provided by the query. If the latter is a valid query, please fix the logic. If the latter is not a valid query (maybe I can't use 'time' multiple times for some reason or something), then please output an error message instead of quietly doing the wrong thing.

This might be related to #8410.

@jsternberg
Copy link
Contributor

I tried to fix this behavior (or at least return an error) since before 1.0 and I finally had a commit for 1.4 that did it in #8712, but that had to be reverted because it broke a very common query pattern that Grafana and many others used. It was reverted in #8771.

This, unfortunately, means the behavior will never be fixed in the lifetime of influxql, although it isn't an issue in ifql.

I'll make a docs issue since I can't find this behavior easily in the docs. It should be in there, but the docs issue will make sure that this strange behavior is definitely documented.

@jsternberg
Copy link
Contributor

I have opened a docs issue: influxdata/docs.influxdata.com-ARCHIVE#1355.

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

No branches or pull requests

2 participants