-
Notifications
You must be signed in to change notification settings - Fork 140
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 lowercase db or schema in connection string #844
base: master
Are you sure you want to change the base?
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@@ -129,6 +129,11 @@ internal Uri BuildLoginUrl() | |||
return loginUrl; | |||
} | |||
|
|||
private string EscapeDbObjectForUrl(string name) | |||
{ | |||
return name == string.Empty ? name : $"\"{name.Replace("\"", "\"\"")}\""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure the name isn't already wrapped with quotes.
Make sure if connection tests are passing after this fix.
@@ -119,8 +119,8 @@ internal Uri BuildLoginUrl() | |||
string schemaValue; | |||
string roleName; | |||
queryParams[RestParams.SF_QUERY_WAREHOUSE] = properties.TryGetValue(SFSessionProperty.WAREHOUSE, out warehouseValue) ? warehouseValue : ""; | |||
queryParams[RestParams.SF_QUERY_DB] = properties.TryGetValue(SFSessionProperty.DB, out dbValue) ? dbValue : ""; | |||
queryParams[RestParams.SF_QUERY_SCHEMA] = properties.TryGetValue(SFSessionProperty.SCHEMA, out schemaValue) ? schemaValue : ""; | |||
queryParams[RestParams.SF_QUERY_DB] = EscapeDbObjectForUrl(properties.TryGetValue(SFSessionProperty.DB, out dbValue) ? dbValue : ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide some unit tests for this change?
Description
There's a bug, that having specified database or schema name in connection string, that contains any lowercase letter, throws exception during connection opening.
This PR fixes that.
Checklist
dotnet test
)