Skip to content

Commit

Permalink
Merged PR 4031: [5.1.2] | Fix access violation when using Express use…
Browse files Browse the repository at this point in the history
…r instances (#2101)

Ports [#2101](#2101)
  • Loading branch information
DavoudEshtehari committed Oct 16, 2023
1 parent b9f133b commit 0df83f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ internal SqlConnectionString(SqlConnectionString connectionOptions, string dataS
_attestationProtocol = connectionOptions._attestationProtocol;
_serverSPN = connectionOptions._serverSPN;
_failoverPartnerSPN = connectionOptions._failoverPartnerSPN;
_hostNameInCertificate = connectionOptions._hostNameInCertificate;
#if NETFRAMEWORK
_connectionReset = connectionOptions._connectionReset;
_contextConnection = connectionOptions._contextConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,15 @@ public void Open_ConnectionString_Whitespace()
Assert.NotNull(ex.Message);
}

[Fact]
public void Open_ConnectionString_UserInstance()
{
SqlConnection cn = new SqlConnection("User Instance=true;");
SqlException ex = Assert.Throws<SqlException>(() => cn.Open());
// Throws without access violation
Assert.NotNull(ex.Message);
}

[Fact]
public void ServerVersion_Connection_Closed()
{
Expand Down

0 comments on commit 0df83f4

Please sign in to comment.