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 | FailoverPartner key check in SqlConnectionPoolGroupProviderInfo #1614

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ private PermissionSet CreateFailoverPermission(SqlConnectionString userConnectio
// the server, we will use that name over what was specified
// in the original connection string.

if (null == userConnectionOptions[SqlConnectionString.KEY.FailoverPartner])
if (userConnectionOptions.ContainsKey(SqlConnectionString.KEY.FailoverPartner) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious how a connection without AG setup can reach this line! I tried locally (Win 10) and in Win Server 2019, but neither got to this line.
Could you reproduce it?

Choose a reason for hiding this comment

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

At least in #1594, the data source was an AG. It's not specified in #1613 whether the data source was an AG.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think the issue occurs without a AG setup. I tried locally prior to this and wasn't able to reproduce.

Choose a reason for hiding this comment

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

I have just experienced this issue in a non-AG setup.

null == userConnectionOptions[SqlConnectionString.KEY.FailoverPartner])
{
keywordToReplace = SqlConnectionString.KEY.Data_Source;
}
Expand Down