Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit ac1012a
Author: dauinsight <145612907+dauinsight@users.noreply.github.com>
Date:   Fri Aug 16 13:22:55 2024 -0700

    Hotfix v3.1.6 Release notes (dotnet#2767)

commit 619fa74
Author: Javad Rahnama <v-jarahn@microsoft.com>
Date:   Thu Aug 15 13:48:15 2024 -0700

    Fix | Fix the issue with Socke.Connect in managed SNI (dotnet#2777)

commit d3658ed
Author: DavoudEshtehari <61173489+DavoudEshtehari@users.noreply.github.com>
Date:   Wed Aug 14 17:18:51 2024 -0700

    Update SNI version to 6.0.0-preview1.24226.4 (dotnet#2772)

commit 7216e84
Author: Benjamin Russell <russellben@microsoft.com>
Date:   Fri Aug 9 12:40:30 2024 -0500

    `null != x` => `x != null` (dotnet#2751)

commit 6fbbb78
Author: Benjamin Russell <russellben@microsoft.com>
Date:   Sat Aug 3 11:47:53 2024 -0500

    Code Cleanup | `null == x` to `x == null` (dotnet#2749)

    - With one approval and CI success, I think that's enough to move ahead on this one.

    * `null == x` to `x == null`

    * Update src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs

    Co-authored-by: David Engel <dengel1012@gmail.com>

    ---------

    Co-authored-by: David Engel <dengel1012@gmail.com>

commit 6f177e3
Author: Aris Rellegue <134557572+arellegue@users.noreply.github.com>
Date:   Tue Jul 30 19:52:38 2024 +0000

    Fix | Fixed some Azure managed identity authentication unit test failures (dotnet#2652)
  • Loading branch information
DavoudEshtehari committed Aug 19, 2024
1 parent 050af61 commit dbd8c65
Show file tree
Hide file tree
Showing 136 changed files with 1,462 additions and 1,337 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,18 @@ This update brings the below changes over the previous release:
- Optimized async method allocations in .NET Framework by porting changes from .NET Core. [#1084](https://github.com/dotnet/SqlClient/pull/1084)
- Various code improvements [#902](https://github.com/dotnet/SqlClient/pull/902) [#925](https://github.com/dotnet/SqlClient/pull/925) [#933](https://github.com/dotnet/SqlClient/pull/933) [#934](https://github.com/dotnet/SqlClient/pull/934) [#1024](https://github.com/dotnet/SqlClient/pull/1024) [#1057](https://github.com/dotnet/SqlClient/pull/1057) [#1122](https://github.com/dotnet/SqlClient/pull/1122) [#1133](https://github.com/dotnet/SqlClient/pull/1133) [#1134](https://github.com/dotnet/SqlClient/pull/1134) [#1141](https://github.com/dotnet/SqlClient/pull/1141) [#1187](https://github.com/dotnet/SqlClient/pull/1187) [#1188](https://github.com/dotnet/SqlClient/pull/1188) [#1223](https://github.com/dotnet/SqlClient/pull/1223) [#1225](https://github.com/dotnet/SqlClient/pull/1225) [#1226](https://github.com/dotnet/SqlClient/pull/1226)

## [Stable release 3.1.6] - 2024-08-15

### Fixed

- Fixed connection to unsubscribe from transaction completion events before returning it to the connection pool. [#2301](https://github.com/dotnet/SqlClient/pull/2301) [#2434](https://github.com/dotnet/SqlClient/pull/2434)
- Fixed `AcquireTokenAsync` timeout handling for edge cases in `ActiveDirectoryAuthenticationProvider`. [#2709](https://github.com/dotnet/SqlClient/pull/2709)

### Changed

- Updated Microsoft.Data.SqlClient.SNI version 3.0.1 to 3.0.2 [#2676](https://github.com/dotnet/SqlClient/pull/2676) which includes the fix for AppDomain crashing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418) and various code refactors.
- Code health improvements: [#2147](https://github.com/dotnet/SqlClient/pull/2147), [#2515](https://github.com/dotnet/SqlClient/pull/2515), [#2517](https://github.com/dotnet/SqlClient/pull/2517) addresses [CVE-2019-0545](https://github.com/advisories/GHSA-2xjx-v99w-gqf3), [#2539](https://github.com/dotnet/SqlClient/pull/2539)

## [Stable release 3.1.5] - 2024-01-09

### Fixed
Expand Down
80 changes: 80 additions & 0 deletions release-notes/3.1/3.1.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Release Notes

## Microsoft.Data.SqlClient 3.1.6 released 15 August 2024

This update brings the below changes over the previous release:

### Fixed

- Fixed connection to unsubscribe from transaction completion events before returning it to the connection pool. [#2301](https://github.com/dotnet/SqlClient/pull/2301) [#2434](https://github.com/dotnet/SqlClient/pull/2434)
- Fixed `AcquireTokenAsync` timeout handling for edge cases in `ActiveDirectoryAuthenticationProvider`. [#2709](https://github.com/dotnet/SqlClient/pull/2709)

### Changed

- Updated Microsoft.Data.SqlClient.SNI version 3.0.1 to 3.0.2 [#2676](https://github.com/dotnet/SqlClient/pull/2676) which includes the fix for AppDomain crashing in issue [#1418](https://github.com/dotnet/SqlClient/issues/1418) and various code refactors.
- Code health improvements: [#2147](https://github.com/dotnet/SqlClient/pull/2147), [#2515](https://github.com/dotnet/SqlClient/pull/2515), [#2517](https://github.com/dotnet/SqlClient/pull/2517) addresses [CVE-2019-0545](https://github.com/advisories/GHSA-2xjx-v99w-gqf3), [#2539](https://github.com/dotnet/SqlClient/pull/2539)

## Target Platform Support

- .NET Framework 4.6.1+ (Windows x86, Windows x64)
- .NET Core 2.1+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)
- .NET Standard 2.0+ (Windows x86, Windows x64, Windows ARM64, Windows ARM, Linux, macOS)

### Dependencies

#### .NET Framework 4.6.1

- Microsoft.Data.SqlClient.SNI 3.0.2
- Azure.Identity 1.3.0
- Microsoft.Identity.Client 4.22.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
- Microsoft.IdentityModel.JsonWebTokens 6.8.0
- System.Configuration.ConfigurationManager 4.7.0
- System.Text.Encodings.Web 4.7.2

#### .NET Core 2.1

- Microsoft.Data.SqlClient.SNI.runtime 3.0.2
- Microsoft.Win32.Registry 4.7.0
- System.Security.Principal.Windows 4.7.0
- System.Text.Encoding.CodePages 4.7.0
- System.Text.Encodings.Web 4.7.2
- System.Diagnostics.DiagnosticSource 4.7.0
- System.Configuration.ConfigurationManager 4.7.0
- System.Runtime.Caching 4.7.0
- Azure.Identity 1.3.0
- Microsoft.Identity.Client 4.22.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
- Microsoft.IdentityModel.JsonWebTokens 6.8.0

#### .NET Core 3.1

- Microsoft.Data.SqlClient.SNI.runtime 3.0.2
- Microsoft.Win32.Registry 4.7.0
- System.Security.Principal.Windows 4.7.0
- System.Text.Encoding.CodePages 4.7.0
- System.Text.Encodings.Web 4.7.2
- System.Diagnostics.DiagnosticSource 4.7.0
- System.Configuration.ConfigurationManager 4.7.0
- System.Runtime.Caching 4.7.0
- Azure.Identity 1.3.0
- Microsoft.Identity.Client 4.22.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
- Microsoft.IdentityModel.JsonWebTokens 6.8.0

#### .NET Standard

- Microsoft.Data.SqlClient.SNI.runtime 3.0.2
- Microsoft.Win32.Registry 4.7.0
- System.Buffers 4.5.1
- System.Memory 4.5.4
- System.Security.Principal.Windows 4.7.0
- System.Text.Encoding.CodePages 4.7.0
- System.Text.Encodings.Web 4.7.2
- System.Runtime.Caching 4.7.0
- Azure.Identity 1.3.0
- Microsoft.Identity.Client 4.22.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect 6.8.0
- Microsoft.IdentityModel.JsonWebTokens 6.8.0
- System.Configuration.ConfigurationManager 4.7.0
- System.Runtime.Loader 4.3.0
1 change: 1 addition & 0 deletions release-notes/3.1/3.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 3.1 stable releases have been shipped:

| Release Date | Version | Notes |
| :-- | :-- | :--: |
| 2024/08/15 | 3.1.6 | [release notes](3.1.6.md) |
| 2024/01/09 | 3.1.5 | [release notes](3.1.5.md) |
| 2023/10/31 | 3.1.4 | [release notes](3.1.4.md) |
| 2023/03/10 | 3.1.3 | [release notes](3.1.3.md) |
Expand Down
1 change: 1 addition & 0 deletions release-notes/3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The following Microsoft.Data.SqlClient 3.1 stable releases have been shipped:

| Release Date | Version | Notes |
| :-- | :-- | :--: |
| 2024/08/15 | 3.1.6 | [release notes](3.1.6.md) |
| 2024/01/09 | 3.1.5 | [release notes](3.1.5.md) |
| 2023/10/31 | 3.1.4 | [release notes](3.1.4.md) |
| 2023/03/10 | 3.1.3 | [release notes](3.1.3.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ byte[] DecryptEncryptionKey()
byte[] message = new byte[encryptedColumnEncryptionKey.Length - signatureLength];
Buffer.BlockCopy(encryptedColumnEncryptionKey, 0, message, 0, encryptedColumnEncryptionKey.Length - signatureLength);

if (null == message)
if (message == null)
{
throw ADP.NullHashFound();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ internal static void ValidateNotNullOrWhitespaceForEach(string[] parameters, str
internal static void ValidateEncryptionAlgorithm(string encryptionAlgorithm, bool isSystemOp)
{
// This validates that the encryption algorithm is RSA_OAEP
if (null == encryptionAlgorithm)
if (encryptionAlgorithm == null)
{
throw ADP.NullAlgorithm(isSystemOp);
}
Expand Down Expand Up @@ -124,8 +124,9 @@ internal static ArgumentException InvalidSignatureTemplate(string masterKeyPath)

internal static ArgumentException InvalidAKVPath(string masterKeyPath, bool isSystemOp)
{
string errorMessage = null == masterKeyPath ? Strings.NullAkvPath
: string.Format(CultureInfo.InvariantCulture, Strings.InvalidAkvPathTemplate, masterKeyPath);
string errorMessage = masterKeyPath == null
? Strings.NullAkvPath
: string.Format(CultureInfo.InvariantCulture, Strings.InvalidAkvPathTemplate, masterKeyPath);
if (isSystemOp)
{
return new ArgumentNullException(Constants.AeParamMasterKeyPath, errorMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal override bool TryOpenConnection(DbConnection outerConnection, DbConnect
// we are completing an asynchronous open
Debug.Assert(retry.Task.Status == TaskStatus.RanToCompletion, "retry task must be completed successfully");
DbConnectionInternal openConnection = retry.Task.Result;
if (null == openConnection)
if (openConnection == null)
{
connectionFactory.SetInnerConnectionTo(outerConnection, this);
throw ADP.InternalConnectionError(ADP.ConnectionError.GetConnectionReturnsNull);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void ClearAllPools()
foreach (KeyValuePair<DbConnectionPoolKey, DbConnectionPoolGroup> entry in connectionPoolGroups)
{
DbConnectionPoolGroup poolGroup = entry.Value;
if (null != poolGroup)
if (poolGroup != null)
{
poolGroup.Clear();
}
Expand All @@ -69,7 +69,7 @@ public void ClearPool(DbConnection connection)
using (TryEventScope.Create("<prov.DbConnectionFactory.ClearPool|API> {0}", GetObjectId(connection)))
{
DbConnectionPoolGroup poolGroup = GetConnectionPoolGroup(connection);
if (null != poolGroup)
if (poolGroup != null)
{
poolGroup.Clear();
}
Expand Down Expand Up @@ -98,15 +98,15 @@ internal virtual DbConnectionPoolProviderInfo CreateConnectionPoolProviderInfo(D

internal DbConnectionInternal CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
{
Debug.Assert(null != owningConnection, "null owningConnection?");
Debug.Assert(null != poolGroup, "null poolGroup?");
Debug.Assert(owningConnection != null, "null owningConnection?");
Debug.Assert(poolGroup != null, "null poolGroup?");

DbConnectionOptions connectionOptions = poolGroup.ConnectionOptions;
DbConnectionPoolGroupProviderInfo poolGroupProviderInfo = poolGroup.ProviderInfo;
DbConnectionPoolKey poolKey = poolGroup.PoolKey;

DbConnectionInternal newConnection = CreateConnection(connectionOptions, poolKey, poolGroupProviderInfo, null, owningConnection, userOptions);
if (null != newConnection)
if (newConnection != null)
{
SqlClientEventSource.Log.HardConnectRequest();
newConnection.MakeNonPooledObject(owningConnection);
Expand All @@ -117,11 +117,11 @@ internal DbConnectionInternal CreateNonPooledConnection(DbConnection owningConne

internal DbConnectionInternal CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
{
Debug.Assert(null != pool, "null pool?");
Debug.Assert(pool != null, "null pool?");
DbConnectionPoolGroupProviderInfo poolGroupProviderInfo = pool.PoolGroup.ProviderInfo;

DbConnectionInternal newConnection = CreateConnection(options, poolKey, poolGroupProviderInfo, pool, owningObject, userOptions);
if (null != newConnection)
if (newConnection != null)
{
SqlClientEventSource.Log.HardConnectRequest();
newConnection.MakePooledConnection(pool);
Expand Down Expand Up @@ -167,8 +167,8 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
{
// if poolgroup is disabled, it will be replaced with a new entry

Debug.Assert(null != owningObject, "null owningObject?");
Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?");
Debug.Assert(owningObject != null, "null owningObject?");
Debug.Assert(connectionPoolGroup != null, "null connectionPoolGroup?");

// It is possible that while the outer connection object has
// been sitting around in a closed and unused state in some long
Expand All @@ -179,7 +179,7 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
// re-create the pool entry whenever it's disabled.

// however, don't rebuild connectionOptions if no pooling is involved - let new connections do that work
if (connectionPoolGroup.IsDisabled && (null != connectionPoolGroup.PoolGroupOptions))
if (connectionPoolGroup.IsDisabled && connectionPoolGroup.PoolGroupOptions != null)
{
SqlClientEventSource.Log.TryTraceEvent("<prov.DbConnectionFactory.GetConnectionPool|RES|INFO|CPOOL> {0}, DisabledPoolGroup={1}", ObjectID, connectionPoolGroup?.ObjectID);

Expand All @@ -188,10 +188,10 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti

// get the string to hash on again
DbConnectionOptions connectionOptions = connectionPoolGroup.ConnectionOptions;
Debug.Assert(null != connectionOptions, "prevent expansion of connectionString");
Debug.Assert(connectionOptions != null, "prevent expansion of connectionString");

connectionPoolGroup = GetConnectionPoolGroup(connectionPoolGroup.PoolKey, poolOptions, ref connectionOptions);
Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?");
Debug.Assert(connectionPoolGroup != null, "null connectionPoolGroup?");
SetConnectionPoolGroup(owningObject, connectionPoolGroup);
}
DbConnectionPool connectionPool = connectionPoolGroup.GetConnectionPool(this);
Expand All @@ -207,19 +207,19 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D

DbConnectionPoolGroup connectionPoolGroup;
Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> connectionPoolGroups = _connectionPoolGroups;
if (!connectionPoolGroups.TryGetValue(key, out connectionPoolGroup) || (connectionPoolGroup.IsDisabled && (null != connectionPoolGroup.PoolGroupOptions)))
if (!connectionPoolGroups.TryGetValue(key, out connectionPoolGroup) || (connectionPoolGroup.IsDisabled && connectionPoolGroup.PoolGroupOptions != null))
{
// If we can't find an entry for the connection string in
// our collection of pool entries, then we need to create a
// new pool entry and add it to our collection.

DbConnectionOptions connectionOptions = CreateConnectionOptions(key.ConnectionString, userConnectionOptions);
if (null == connectionOptions)
if (connectionOptions == null)
{
throw ADP.InternalConnectionError(ADP.ConnectionError.ConnectionOptionsMissing);
}

if (null == userConnectionOptions)
if (userConnectionOptions == null)
{ // we only allow one expansion on the connection string

userConnectionOptions = connectionOptions;
Expand All @@ -236,9 +236,9 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
}

// We don't support connection pooling on Win9x
if (null == poolOptions)
if (poolOptions == null)
{
if (null != connectionPoolGroup)
if (connectionPoolGroup != null)
{
// reusing existing pool option in case user originally used SetConnectionPoolOptions
poolOptions = connectionPoolGroup.PoolGroupOptions;
Expand Down Expand Up @@ -276,10 +276,10 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
Debug.Assert(!connectionPoolGroup.IsDisabled, "Disabled pool entry discovered");
}
}
Debug.Assert(null != connectionPoolGroup, "how did we not create a pool entry?");
Debug.Assert(null != userConnectionOptions, "how did we not have user connection options?");
Debug.Assert(connectionPoolGroup != null, "how did we not create a pool entry?");
Debug.Assert(userConnectionOptions != null, "how did we not have user connection options?");
}
else if (null == userConnectionOptions)
else if (userConnectionOptions == null)
{
userConnectionOptions = connectionPoolGroup.ConnectionOptions;
}
Expand All @@ -303,7 +303,7 @@ private void PruneConnectionPoolGroups(object state)
DbConnectionPool[] poolsToRelease = _poolsToRelease.ToArray();
foreach (DbConnectionPool pool in poolsToRelease)
{
if (null != pool)
if (pool != null)
{
pool.Clear();

Expand All @@ -328,7 +328,7 @@ private void PruneConnectionPoolGroups(object state)
DbConnectionPoolGroup[] poolGroupsToRelease = _poolGroupsToRelease.ToArray();
foreach (DbConnectionPoolGroup poolGroup in poolGroupsToRelease)
{
if (null != poolGroup)
if (poolGroup != null)
{
int poolsLeft = poolGroup.Clear(); // may add entries to _poolsToRelease

Expand All @@ -353,7 +353,7 @@ private void PruneConnectionPoolGroups(object state)

foreach (KeyValuePair<DbConnectionPoolKey, DbConnectionPoolGroup> entry in connectionPoolGroups)
{
if (null != entry.Value)
if (entry.Value != null)
{
Debug.Assert(!entry.Value.IsDisabled, "Disabled pool entry discovered");

Expand All @@ -380,7 +380,7 @@ internal void QueuePoolForRelease(DbConnectionPool pool, bool clearing)
// Queue the pool up for release -- we'll clear it out and dispose
// of it as the last part of the pruning timer callback so we don't
// do it with the pool entry or the pool collection locked.
Debug.Assert(null != pool, "null pool?");
Debug.Assert(pool != null, "null pool?");

// set the pool to the shutdown state to force all active
// connections to be automatically disposed when they
Expand All @@ -401,7 +401,7 @@ internal void QueuePoolForRelease(DbConnectionPool pool, bool clearing)

internal void QueuePoolGroupForRelease(DbConnectionPoolGroup poolGroup)
{
Debug.Assert(null != poolGroup, "null poolGroup?");
Debug.Assert(poolGroup != null, "null poolGroup?");
SqlClientEventSource.Log.TryTraceEvent("<prov.DbConnectionFactory.QueuePoolGroupForRelease|RES|INFO|CPOOL> {0}, poolGroup={1}", ObjectID, poolGroup.ObjectID);

lock (_poolGroupsToRelease)
Expand Down
Loading

0 comments on commit dbd8c65

Please sign in to comment.