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

Incorrect results when using operator != with tags #2097

Closed
smonkewitz opened this issue Mar 27, 2015 · 5 comments
Closed

Incorrect results when using operator != with tags #2097

smonkewitz opened this issue Mar 27, 2015 · 5 comments
Assignees

Comments

@smonkewitz
Copy link

OS: OSX 10.10.2
Go: version 1.4.2
InfluxDB master commit 0bcec78, built from source

How to reproduce:

# Create database
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE bug"

# Write a single point
curl -d '{"database" : "bug", "points": [{"name":"test","tags":{"foo":"bar"},"fields":{"value":1}}]}' -H "Content-Type: application/json" http://localhost:8086/write

# Count records with foo = 'bar'. I get back 1 value, as expected.
curl -G http://localhost:8086/query --data-urlencode "db=bug" --data-urlencode "q=SELECT COUNT(value) FROM test WHERE foo='bar'"
# {"results":[{"series":[{"name":"test","columns":["time","COUNT"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}

# Count records with foo != 'bar'. I still get back 1 value, which is incorrect.
curl -G http://localhost:8086/query --data-urlencode "db=bug" --data-urlencode "q=SELECT COUNT(value) FROM test WHERE foo!='bar'"
# {"results":[{"series":[{"name":"test","columns":["time","COUNT"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}
curl -G http://localhost:8086/query --data-urlencode "db=bug" --data-urlencode "q=SELECT COUNT(value) FROM test WHERE foo<>'bar'"
# {"results":[{"series":[{"name":"test","columns":["time","COUNT"],"values":[["1970-01-01T00:00:00Z",1]]}]}]}
@otoolep
Copy link
Contributor

otoolep commented Mar 27, 2015

Thanks @smonkewitz

@dgnorton -- should this work?

@dgnorton
Copy link
Contributor

@otoolep yes, it should work. I get the same result shown above.

@otoolep otoolep changed the title Incorrect results when using operator != with tags Incorrect results when using operator != with fields Mar 28, 2015
@otoolep otoolep changed the title Incorrect results when using operator != with fields Incorrect results when using operator != with tags Mar 28, 2015
@otoolep otoolep self-assigned this Mar 28, 2015
@otoolep
Copy link
Contributor

otoolep commented Mar 28, 2015

Working towards fixing this in #2104. We have the same problem with != compares with fields. That has been fixed, now tags need to be fixed.

@otoolep otoolep mentioned this issue Mar 30, 2015
otoolep added a commit that referenced this issue Mar 30, 2015
If so, then return all series IDs which do not match.

Fix for issue #2097
@otoolep
Copy link
Contributor

otoolep commented Mar 31, 2015

Fixed by PR #2105

otoolep added a commit that referenced this issue Mar 31, 2015
If so, then return all series IDs which do not match.

Fix for issue #2097
@otoolep
Copy link
Contributor

otoolep commented Mar 31, 2015

Fixed.

@otoolep otoolep closed this as completed Mar 31, 2015
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

3 participants