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

Fix querying measurement and fields with spaces #3435

Merged
merged 3 commits into from
Jul 22, 2015
Merged

Fix querying measurement and fields with spaces #3435

merged 3 commits into from
Jul 22, 2015

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Jul 22, 2015

In 0.9.1, measurement and field names were getting added to the shard index with and without escaped characters differently from 0.9.0. This prevented queries against the measurements because the parser would look for an unescaped measurement, but the index would have the escaped version causing the measurement to not be queryable. This fix ensures that the index versions are unescaped and also fixes some query bugs where fields and measurements with spaces would not be parseable.

Fixes #3319

switch f.Expr.(type) {
case *VarRef:
// Escape any quotes in the field
if strings.Contains(str, `"`) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to handle single quotes too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I'll add a test and fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@pauldix
Copy link
Member

pauldix commented Jul 22, 2015

+1, cherry pick into 0.9.2

jwilder added a commit that referenced this pull request Jul 22, 2015
Fix querying measurement and fields with spaces
@jwilder jwilder merged commit 0a580b0 into 0.9.2 Jul 22, 2015
@jwilder jwilder deleted the jw-3319-fix branch July 22, 2015 20:42
@beckettsean
Copy link
Contributor

@jwilder does this PR do anything to fix the corrupted indexes for people who upgraded to 0.9.1, or is the only solution destroy the data and try again with 0.9.2?

@jwilder
Copy link
Contributor Author

jwilder commented Jul 22, 2015

It should. The indexes are in-memory so they were being indexed differently. The data should still be in the shards unless it was manually dropped or deleted on disk by the user.

I tested this by creating measurement and fields with spaces in 0.9.0, upgraded to 0.9.1 and verified the reported error. I then tested this fix with those existing shards by upgrading from both 0.9.0 and 0.9.1 to 0.9.2. Both upgrade paths returned the existing data and was query-able.

@beckettsean
Copy link
Contributor

That's awesome! Thanks for verifying.

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

Successfully merging this pull request may close these issues.

3 participants