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

Usernames and database names have to be quoted. #248

Merged
merged 1 commit into from
Feb 6, 2021

Conversation

estheruary
Copy link
Contributor

It's legal for databases and users to have odd characters that require quoting. This is done in some parts of the code but not others. I think I found all the places where the quoting needs to happen but I would appreciate a look over.

Errors

Hopefully some other poor soul won't have waste time finding this out the hard way. So here's some error dumps that search engines might key onto if your database has a - in it.

InfluxDB::Error: {"error":"error parsing query: found -, expected ; at line 1, char 20"}
Feb 02 18:11:33 host c32443048d41[3669]: /usr/local/bundle/gems/influxdb-0.3.17/lib/influxdb/client/http.rb:85:in `resolve_error': {"error":"error parsing query: found -, expected ; at line 1, char 20"} (InfluxDB::Error)
Feb 02 18:11:33 host c32443048d41[3669]:         from /usr/local/bundle/gems/influxdb-0.3.17/lib/influxdb/client/http.rb:19:in `block in get'
Feb 02 18:11:33 host c32443048d41[3669]:         from /usr/local/bundle/gems/influxdb-0.3.17/lib/influxdb/client/http.rb:53:in `connect_with_retry'
Feb 02 18:11:33 host c32443048d41[3669]:         from /usr/local/bundle/gems/influxdb-0.3.17/lib/influxdb/client/http.rb:11:in `get'
Feb 02 18:11:33 host c32443048d41[3669]:         from /usr/local/bundle/gems/influxdb-0.3.17/lib/influxdb/query/core.rb:129:in `execute'
Feb 02 18:11:33 host c32443048d41[3669]:         from /usr/local/bundle/gems/influxdb-0.3.17/lib/influxdb/query/database.rb:5:in `create_database'

It's legal for databases and users to have odd characters (like '-')
that require quoting. This is done in some parts of the code but not
others. This fixes that.
Copy link
Collaborator

@hennevogel hennevogel left a comment

Choose a reason for hiding this comment

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

Nice catch, especially together with #242

Thank you @estheruary 💐

@hennevogel hennevogel merged commit 409f1e1 into InfluxCommunity:master Feb 6, 2021
hennevogel added a commit to hennevogel/influxdb-ruby that referenced this pull request Feb 6, 2021
hennevogel added a commit to hennevogel/influxdb-ruby that referenced this pull request Feb 6, 2021
@hennevogel hennevogel mentioned this pull request Feb 6, 2021
hennevogel added a commit that referenced this pull request Feb 6, 2021
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.

2 participants