Skip to content

Commit 549c62d

Browse files
Merge branch 'master' of https://github.com/dotnet/SqlClient into ScaledDecimalParameterImprovement
# Conflicts: # src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
2 parents bb87b19 + f0f0f00 commit 549c62d

File tree

87 files changed

+2226
-1681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2226
-1681
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,35 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

7+
## [Preview Release 2.0.0-preview1.20084.1] - 2020-03-24
8+
9+
### Added
10+
- Added support for capturing EventSource traces in .NET Framework, .NET Core, and .NET Standard applications [#399](https://github.com/dotnet/SqlClient/pull/399) [#461](https://github.com/dotnet/SqlClient/pull/461) [#479](https://github.com/dotnet/SqlClient/pull/479) [#483](https://github.com/dotnet/SqlClient/pull/483) [#484](https://github.com/dotnet/SqlClient/pull/484)
11+
- Added support for Cross-platform TCP Keep Alive applicable to .NET Core 3.1+ applications [#395](https://github.com/dotnet/SqlClient/pull/395)
12+
- Added support for enabling Managed networking implementation on Windows applicable to .NET Core and .NET Standard applications [#477](https://github.com/dotnet/SqlClient/pull/477)
13+
- Added `RowsCopied` property in `SqlBulkCopy` to expose count of copied rows [#409](https://github.com/dotnet/SqlClient/pull/409)
14+
- Added "NeutralResourcesLanguage" attribute for .NET Framework assembly [#433](https://github.com/dotnet/SqlClient/pull/433)
15+
- Added caching for invariant culture check result [#376](https://github.com/dotnet/SqlClient/pull/376)
16+
- Added cached `SqlReferenceCollection.FindLiveReaderContext` objects [#380](https://github.com/dotnet/SqlClient/pull/380)
17+
18+
### Fixed
19+
- Fixed Access Token behavior in connection pool to perform string comparison [#443](https://github.com/dotnet/SqlClient/pull/443)
20+
- Fixed concurrent connection speed issues when connecting with Azure Active Directory Authentication modes in .NET Core [#466](https://github.com/dotnet/SqlClient/pull/466)
21+
- Fixed issues with `Password` persistence in Connection String [#453](https://github.com/dotnet/SqlClient/pull/453)
22+
23+
### Changes
24+
- Updated all driver assemblies to be CLS Compliant [#396](https://github.com/dotnet/SqlClient/pull/396)
25+
- Updated Bulk Copy error messages to also include Column, Row and non-encrypted Data information [#437](https://github.com/dotnet/SqlClient/pull/437)
26+
- Updated error messages for "Always Encrypted - Secure Enclaves" to handle 'Attestation Protocol' and fixed typos [#421](https://github.com/dotnet/SqlClient/pull/421) [#397](https://github.com/dotnet/SqlClient/pull/397)
27+
- Removed sync over async in `SNINpHandle.EnableSsl` [#474](https://github.com/dotnet/SqlClient/pull/474)
28+
- Changed non-generic `ArrayList` to `List<T>` in `SqlBulkCopy` [#457](https://github.com/dotnet/SqlClient/pull/457)
29+
- Multiple performance improvements [#377](https://github.com/dotnet/SqlClient/pull/377) [#378](https://github.com/dotnet/SqlClient/pull/378) [#379](https://github.com/dotnet/SqlClient/pull/379)
30+
31+
### Breaking Changes
32+
- The driver will now perform Server Certificate validation when TLS encryption is enforced by the target Server, which is the default for Azure connections [#391](https://github.com/dotnet/SqlClient/pull/391)
33+
- `SqlDataReader.GetSchemaTable()` now returns an empty `DataTable` instead of returning `null` [#419](https://github.com/dotnet/SqlClient/pull/419)
34+
35+
736
## [Stable Release 1.1.1] - 2020-02-14
837

938
### Fixed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Release Notes
2+
3+
## Microsoft.Data.SqlClient 2.0.0-preview2.20084.1 released 24 March 2020
4+
5+
This update brings the below changes over the previous release:
6+
7+
### Added
8+
- Added support for capturing EventSource traces in .NET Framework, .NET Core, and .NET Standard applications [#399](https://github.com/dotnet/SqlClient/pull/399) [#461](https://github.com/dotnet/SqlClient/pull/461) [#479](https://github.com/dotnet/SqlClient/pull/479) [#483](https://github.com/dotnet/SqlClient/pull/483) [#484](https://github.com/dotnet/SqlClient/pull/484)
9+
- Added support for Cross-platform TCP Keep Alive applicable to .NET Core 3.1+ applications [#395](https://github.com/dotnet/SqlClient/pull/395)
10+
- Added support for enabling Managed networking implementation on Windows applicable to .NET Core and .NET Standard applications [#477](https://github.com/dotnet/SqlClient/pull/477)
11+
- Added `RowsCopied` property in `SqlBulkCopy` to expose count of copied rows [#409](https://github.com/dotnet/SqlClient/pull/409)
12+
- Added "NeutralResourcesLanguage" attribute for .NET Framework assembly [#433](https://github.com/dotnet/SqlClient/pull/433)
13+
- Added caching for invariant culture check result [#376](https://github.com/dotnet/SqlClient/pull/376)
14+
- Added cached `SqlReferenceCollection.FindLiveReaderContext` objects [#380](https://github.com/dotnet/SqlClient/pull/380)
15+
16+
### Fixed
17+
- Fixed Access Token behavior in connection pool to perform string comparison [#443](https://github.com/dotnet/SqlClient/pull/443)
18+
- Fixed concurrent connection speed issues when connecting with Azure Active Directory Authentication modes in .NET Core [#466](https://github.com/dotnet/SqlClient/pull/466)
19+
- Fixed issues with `Password` persistence in Connection String [#453](https://github.com/dotnet/SqlClient/pull/453)
20+
21+
### Changes
22+
- Updated all driver assemblies to be CLS Compliant [#396](https://github.com/dotnet/SqlClient/pull/396)
23+
- Updated Bulk Copy error messages to also include Column, Row and non-encrypted Data information [#437](https://github.com/dotnet/SqlClient/pull/437)
24+
- Updated error messages for "Always Encrypted - Secure Enclaves" to handle 'Attestation Protocol' and fixed typos [#421](https://github.com/dotnet/SqlClient/pull/421) [#397](https://github.com/dotnet/SqlClient/pull/397)
25+
- Removed sync over async in `SNINpHandle.EnableSsl` [#474](https://github.com/dotnet/SqlClient/pull/474)
26+
- Changed non-generic `ArrayList` to `List<T>` in `SqlBulkCopy` [#457](https://github.com/dotnet/SqlClient/pull/457)
27+
- Multiple performance improvements [#377](https://github.com/dotnet/SqlClient/pull/377) [#378](https://github.com/dotnet/SqlClient/pull/378) [#379](https://github.com/dotnet/SqlClient/pull/379)
28+
29+
### Breaking Changes
30+
- The driver will now perform Server Certificate validation when TLS encryption is enforced by the target Server, which is the default for Azure connections [#391](https://github.com/dotnet/SqlClient/pull/391)
31+
- `SqlDataReader.GetSchemaTable()` now returns empty `DataTable` instead of returning `null` [#419](https://github.com/dotnet/SqlClient/pull/419)
32+
33+
34+
### Introducing EventSource tracing support
35+
This release introduces support for capturing EventSource trace logs for debugging applications. In order to capture these traces, client applications must listen to events from SqlClient's EventSource implementation:
36+
37+
"Microsoft.Data.SqlClient.EventSource"
38+
39+
Supported Event Keywords are:
40+
41+
| Keyword Name | Value | Description |
42+
| ------------ | ----- | ----------- |
43+
| ExecutionTrace | 1 | Turns on capturing Start/Stop events before and after command execution. |
44+
| Trace | 2 | Turns on capturing basic application flow trace events. |
45+
| Scope | 4 | Turns on capturing enter and exit events |
46+
| NotificationTrace | 8 | Turns on capturing `SqlNotification` trace events |
47+
| NotificationScope | 16 | Turns on capturing `SqlNotification` scope enter and exit events |
48+
| PoolerTrace | 32 | Turns on capturing connection pooling flow trace events. |
49+
| PoolerScope | 64 | Turns on capturing connection pooling scope trace events. |
50+
| AdvancedTrace | 128 | Turns on capturing advanced flow trace events. |
51+
| AdvancedTraceBin | 256 | Turns on capturing advanced flow trace events with additional information. |
52+
| CorrelationTrace | 512 | Turns on capturing correlation flow trace events. |
53+
| StateDump | 1024 | Turns on capturing full state dump of `SqlConnection` |
54+
| SNITrace | 2048 | Turns on capturing flow trace events from Managed Networking implementation (only applicable in .NET Core) |
55+
| SNIScope | 4096 | Turns on capturing scope events from Managed Networking implementation (only applicable in .NET Core) |
56+
|||
57+
58+
### Enabling Managed networking on Windows
59+
This release introduces a new AppContext switch "Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows" that enables the use of Managed SNI on Windows for testing and debugging purposes. This switch will toggle the driver's behavior to use Managed SNI in .NET Core 2.1+ and .NET Standard 2.0+ projects on Windows.
60+
61+
To set the switch from app startup, specify:
62+
63+
```cs
64+
AppContext.SetSwitch("Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows", true);
65+
```
66+
67+
> [NOTE] **Known differences when compared to Native SNI.dll**: Managed SNI does not support non-domain Windows Authentication.
68+
69+
70+
## Target Platform Support
71+
72+
- .NET Framework 4.6+
73+
- .NET Core 2.1+ (Windows x86, Windows x64, Linux, macOS)
74+
- .NET Standard 2.0+ (Windows x86, Windows x64, Linux, macOS)
75+
76+
### Dependencies
77+
78+
#### .NET Framework
79+
80+
- Microsoft.Data.SqlClient.SNI 1.1.0+
81+
- Microsoft.Identity.Client 3.0.8
82+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
83+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
84+
85+
#### .NET Core 2.1
86+
87+
- runtime.native.System.Data.SqlClient.sni 4.4.0
88+
- Microsoft.Win32.Registry 4.7.0
89+
- System.Security.Principal.Windows 4.7.0
90+
- System.Text.Encoding.CodePages 4.7.0
91+
- System.Diagnostics.DiagnosticSource 4.7.0
92+
- System.Configuration.ConfigurationManager 4.7.0
93+
- System.Runtime.Caching 4.7.0
94+
- Microsoft.Identity.Client 4.7.1
95+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
96+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
97+
98+
#### .NET Core 3.1
99+
100+
- runtime.native.System.Data.SqlClient.sni 4.4.0
101+
- Microsoft.Win32.Registry 4.7.0
102+
- System.Security.Principal.Windows 4.7.0
103+
- System.Text.Encoding.CodePages 4.7.0
104+
- System.Diagnostics.DiagnosticSource 4.7.0
105+
- System.Configuration.ConfigurationManager 4.7.0
106+
- System.Runtime.Caching 4.7.0
107+
- Microsoft.Identity.Client 4.7.1
108+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
109+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
110+
111+
#### .NET Standard
112+
113+
- runtime.native.System.Data.SqlClient.sni 4.4.0
114+
- Microsoft.Win32.Registry 4.7.0
115+
- System.Buffers 4.5.0
116+
- System.Diagnostics.DiagnosticSource 4.7.0
117+
- System.Memory 4.5.3
118+
- System.Security.Principal.Windows 4.7.0
119+
- System.Text.Encoding.CodePages 4.7.0
120+
- System.Configuration.ConfigurationManager 4.7.0
121+
- Microsoft.Identity.Client 4.7.1
122+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
123+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0

release-notes/2.0/2.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ The following Microsoft.Data.SqlClient 2.0 preview releases have been shipped:
55
| Release Date | Version | Notes |
66
| :-- | :-- | :--: |
77
| 2020/01/21 | 2.0.0-preview1.20021.1 | [release notes](2.0.0-preview1.md) |
8+
| 2020/03/24 | 2.0.0-preview2.20084.1 | [release notes](2.0.0-preview2.md) |

release-notes/2.0/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ The following Microsoft.Data.SqlClient 2.0 preview releases have been shipped:
55
| Release Date | Version | Notes |
66
| :-- | :-- | :--: |
77
| 2020/01/21 | 2.0.0-preview1.20021.1 | [release notes](2.0.0-preview1.md) |
8+
| 2020/03/24 | 2.0.0-preview1.20084.1 | [release notes](2.0.0-preview2.md) |

src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/Common/DbConnectionOptions.Common.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private static bool CompareInsensitiveInvariant(string strvalue, string strconst
161161
[System.Diagnostics.Conditional("DEBUG")]
162162
private static void DebugTraceKeyValuePair(string keyname, string keyvalue, Dictionary<string, string> synonyms)
163163
{
164-
if (SqlClientEventSource.Log.IsAdvanceTraceOn())
164+
if (SqlClientEventSource.Log.IsAdvancedTraceOn())
165165
{
166166
Debug.Assert(string.Equals(keyname, keyname?.ToLower(), StringComparison.InvariantCulture), "missing ToLower");
167167
string realkeyname = ((null != synonyms) ? (string)synonyms[keyname] : keyname);
@@ -171,11 +171,11 @@ private static void DebugTraceKeyValuePair(string keyname, string keyvalue, Dict
171171
// don't trace passwords ever!
172172
if (null != keyvalue)
173173
{
174-
SqlClientEventSource.Log.AdvanceTrace("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}', KeyValue='{1}'", keyname, keyvalue);
174+
SqlClientEventSource.Log.AdvancedTraceEvent("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}', KeyValue='{1}'", keyname, keyvalue);
175175
}
176176
else
177177
{
178-
SqlClientEventSource.Log.AdvanceTrace("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}'", keyname);
178+
SqlClientEventSource.Log.AdvancedTraceEvent("<comm.DbConnectionOptions|INFO|ADV> KeyName='{0}'", keyname);
179179
}
180180
}
181181
}

src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/ProviderBase/DbConnectionFactory.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ abstract public DbProviderFactory ProviderFactory
4949

5050
public void ClearAllPools()
5151
{
52-
long scopeID = SqlClientEventSource.Log.ScopeEnterEvent("<prov.DbConnectionFactory.ClearAllPools|{0}>", "API");
52+
long scopeID = SqlClientEventSource.Log.ScopeEnterEvent("<prov.DbConnectionFactory.ClearAllPools|API");
5353
try
5454
{
5555
Dictionary<DbConnectionPoolKey, DbConnectionPoolGroup> connectionPoolGroups = _connectionPoolGroups;
@@ -71,7 +71,7 @@ public void ClearAllPools()
7171
public void ClearPool(DbConnection connection)
7272
{
7373
ADP.CheckArgumentNull(connection, nameof(connection));
74-
long scopeID = SqlClientEventSource.Log.ScopeEnterEvent("<prov.DbConnectionFactory.ClearPool|API> {0}#", GetObjectId(connection));
74+
long scopeID = SqlClientEventSource.Log.ScopeEnterEvent("<prov.DbConnectionFactory.ClearPool|API> {0}", GetObjectId(connection));
7575
try
7676
{
7777
DbConnectionPoolGroup poolGroup = GetConnectionPoolGroup(connection);
@@ -126,7 +126,7 @@ internal DbConnectionInternal CreateNonPooledConnection(DbConnection owningConne
126126
{
127127
newConnection.MakeNonPooledObject(owningConnection);
128128
}
129-
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.CreateNonPooledConnection|RES|CPOOL> {0}#, Non-pooled database connection created.", ObjectID);
129+
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.CreateNonPooledConnection|RES|CPOOL> {0}, Non-pooled database connection created.", ObjectID);
130130
return newConnection;
131131
}
132132

@@ -140,7 +140,7 @@ internal DbConnectionInternal CreatePooledConnection(DbConnectionPool pool, DbCo
140140
{
141141
newConnection.MakePooledConnection(pool);
142142
}
143-
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.CreatePooledConnection|RES|CPOOL> {0}#, Pooled database connection created.", ObjectID);
143+
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.CreatePooledConnection|RES|CPOOL> {0}, Pooled database connection created.", ObjectID);
144144
return newConnection;
145145
}
146146

@@ -195,7 +195,7 @@ private DbConnectionPool GetConnectionPool(DbConnection owningObject, DbConnecti
195195
// however, don't rebuild connectionOptions if no pooling is involved - let new connections do that work
196196
if (connectionPoolGroup.IsDisabled && (null != connectionPoolGroup.PoolGroupOptions))
197197
{
198-
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.GetConnectionPool|RES|INFO|CPOOL> {0}#, DisabledPoolGroup={1}#", ObjectID, connectionPoolGroup.ObjectID);
198+
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.GetConnectionPool|RES|INFO|CPOOL> {0}, DisabledPoolGroup={1}", ObjectID, connectionPoolGroup.ObjectID);
199199

200200
// reusing existing pool option in case user originally used SetConnectionPoolOptions
201201
DbConnectionPoolGroupOptions poolOptions = connectionPoolGroup.PoolGroupOptions;
@@ -303,7 +303,7 @@ internal DbConnectionPoolGroup GetConnectionPoolGroup(DbConnectionPoolKey key, D
303303
private void PruneConnectionPoolGroups(object state)
304304
{
305305
// when debugging this method, expect multiple threads at the same time
306-
SqlClientEventSource.Log.AdvanceTrace("<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> {0}#", ObjectID);
306+
SqlClientEventSource.Log.AdvancedTraceEvent("<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> {0}", ObjectID);
307307

308308
// First, walk the pool release list and attempt to clear each
309309
// pool, when the pool is finally empty, we dispose of it. If the
@@ -323,7 +323,7 @@ private void PruneConnectionPoolGroups(object state)
323323
if (0 == pool.Count)
324324
{
325325
_poolsToRelease.Remove(pool);
326-
SqlClientEventSource.Log.AdvanceTrace("<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> {0}#, ReleasePool={1}#", ObjectID, pool.ObjectID);
326+
SqlClientEventSource.Log.AdvancedTraceEvent("<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> {0}, ReleasePool={1}", ObjectID, pool.ObjectID);
327327
}
328328
}
329329
}
@@ -347,7 +347,7 @@ private void PruneConnectionPoolGroups(object state)
347347
if (0 == poolsLeft)
348348
{
349349
_poolGroupsToRelease.Remove(poolGroup);
350-
SqlClientEventSource.Log.AdvanceTrace("<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> {0}#, ReleasePoolGroup={1}#", ObjectID, poolGroup.ObjectID);
350+
SqlClientEventSource.Log.AdvancedTraceEvent("<prov.DbConnectionFactory.PruneConnectionPoolGroups|RES|INFO|CPOOL> {0}, ReleasePoolGroup={1}", ObjectID, poolGroup.ObjectID);
351351
}
352352
}
353353
}
@@ -410,7 +410,7 @@ internal void QueuePoolForRelease(DbConnectionPool pool, bool clearing)
410410
internal void QueuePoolGroupForRelease(DbConnectionPoolGroup poolGroup)
411411
{
412412
Debug.Assert(null != poolGroup, "null poolGroup?");
413-
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.QueuePoolGroupForRelease|RES|INFO|CPOOL> {0}#, poolGroup={1}#", ObjectID, poolGroup.ObjectID);
413+
SqlClientEventSource.Log.TraceEvent("<prov.DbConnectionFactory.QueuePoolGroupForRelease|RES|INFO|CPOOL> {0}, poolGroup={1}", ObjectID, poolGroup.ObjectID);
414414

415415
lock (_poolGroupsToRelease)
416416
{

0 commit comments

Comments
 (0)