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

[0.9.0rc32] Query on empty database say database not found #2851

Closed
beckettsean opened this issue Jun 9, 2015 · 4 comments
Closed

[0.9.0rc32] Query on empty database say database not found #2851

beckettsean opened this issue Jun 9, 2015 · 4 comments
Assignees
Milestone

Comments

@beckettsean
Copy link
Contributor

From https://groups.google.com/d/msgid/influxdb/87cd208a-3edb-4df0-8590-b9f13bfb05a5%40googlegroups.com


The message returned when querying an empty database is not relevant. It say the database is not found.

Create an new database.

curl -G 'http://localhost:8086/query' --data-urlencode "q=create database test"

Show it has been created.

curl -G 'http://localhost:8086/query' --data-urlencode "q=show databases"
{"results":[{"series":[{"name":"databases","columns":["name"],"values":[["test"]]}]}]}

Do a query.

curl -G 'http://localhost:8086/query' --data-urlencode "db=test" --data-urlencode "q=select * from /.*/"
{"results":[{"error":"database not found: test"}]}

It's not an error from my point of view. Is there a reason to return an error message instead of an empty set ?

@otoolep otoolep self-assigned this Jun 9, 2015
@beckettsean
Copy link
Contributor Author

Possible duplication of #2258

@beckettsean beckettsean added this to the 0.9.0 milestone Jun 9, 2015
@otoolep
Copy link
Contributor

otoolep commented Jun 10, 2015

This error is coming from expandSources in the QueryExecutor type.

@otoolep
Copy link
Contributor

otoolep commented Jun 10, 2015

So the issue with this is that the in-RAM index associated with each shard does not have a DatabaseIndex object inserted until the first point for that database is written into the shard.

@otoolep
Copy link
Contributor

otoolep commented Jun 11, 2015

Fixed in RC34.

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

2 participants