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

Combinations of AND+OR operators in WHERE doesn't work #6866

Closed
pga23 opened this issue Jun 17, 2016 · 2 comments
Closed

Combinations of AND+OR operators in WHERE doesn't work #6866

pga23 opened this issue Jun 17, 2016 · 2 comments

Comments

@pga23
Copy link

pga23 commented Jun 17, 2016

Bug report

System info:
Ubuntu 16.04 + IndluxDB v1.0.0-beta1

Steps to reproduce:

Insert example data:

mydata,reg=1 value=11 100
mydata,reg=2 value=21 100
mydata,reg=1 value=12 200
mydata,reg=2 value=22 200

Run the query:

SELECT * FROM mydata WHERE (time=100 AND reg='1') OR (time=200 AND reg='2')

Expected behavior:
Following results set:

time    reg   value
100     1     11
200     2     22

Actual behavior:
No data

Additional info:
SELECT * FROM mydata WHERE time=100 AND reg='1'
and
SELECT * FROM mydata WHERE time=200 AND reg='2'
returns data correctly, so by adding OR I expected results of both

@jsternberg
Copy link
Contributor

I think this is a duplicate of #3290. If I'm wrong, please respond and I can reopen this. Thanks.

@pga23
Copy link
Author

pga23 commented Jun 17, 2016

I've already tested it also for the following queries:

SELECT * FROM mydata WHERE (time='1970-01-01T00:00:00.0000002Z' AND reg='2')
SELECT * FROM mydata WHERE (time='1970-01-01T00:00:00.0000001Z' AND reg='1')
and additionally
SELECT * FROM mydata WHERE (time='1970-01-01T00:00:00.0000002Z' OR reg='2')

all above returns correct data.

Combination of above with OR:
SELECT * FROM mydata WHERE (time='1970-01-01T00:00:00.0000001Z' AND reg='1') OR (time='1970-01-01T00:00:00.0000002Z' AND reg='2')
returns empty result set.

It looks similar, but I'm not sure if it is the same issue.

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