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
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.
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.
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.
The text was updated successfully, but these errors were encountered: