fix(mssql): escape special characters for odbc#889
Merged
Conversation
goldmedal
reviewed
Nov 5, 2024
ibis-server/app/model/data_source.py
Outdated
Comment on lines
+168
to
+172
| def _escape_special_characters_for_odbc(value: str) -> str: | ||
| if ";" in value or value.startswith("{"): | ||
| return "{" + value.replace("}", "}}") + "}" | ||
| else: | ||
| return value |
Contributor
There was a problem hiding this comment.
Could we always add brackets? Maybe we don't need to check if it contains any illegal character? 🤔
Contributor
Author
There was a problem hiding this comment.
It seems to be okay.
…til ibis handle special characters
Contributor
Author
|
The connection string test should wait until ibis handles special characters by ibis-project/ibis#10437. |
goldmedal
approved these changes
Nov 5, 2024
Contributor
goldmedal
left a comment
There was a problem hiding this comment.
Thanks @grieve54706 LGTM
Contributor
filed #890 for it |
gagan-bhullar-tech
pushed a commit
to gagan-bhullar-tech/wren-engine
that referenced
this pull request
Nov 6, 2024
grieve54706
added a commit
that referenced
this pull request
Dec 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We found the error
Because the password of mssql includes special characters like
{R;3G1/8Al2AniRyethat start with{or include;.It should be covered by
{and}and replace}with}}.Reference:
https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-databases
https://stackoverflow.com/questions/78531086/pyodbc-connection-string-correctly-escaping-password-with-special-characters/78532507#78532507