From cf5aabf52637a841819d92d6c1f992784bae8d43 Mon Sep 17 00:00:00 2001 From: David Engel Date: Mon, 9 May 2022 10:15:20 -0700 Subject: [PATCH] Doc changes for TDS 8 (#2) * Adding TDS8 support to netcore * Doc changes for TDS 8 Co-authored-by: JRahnama --- .../Microsoft.Data.SqlClient/SqlConnection.xml | 4 ++-- .../SqlConnectionEncryptionOption.xml | 13 +++++++------ .../SqlConnectionStringBuilder.xml | 8 ++++---- src/Microsoft.Data.SqlClient.sln | 16 +--------------- .../netcore/ref/Microsoft.Data.SqlClient.cs | 1 - .../Microsoft/Data/SqlClient/SNI/SNINpHandle.cs | 1 - .../src/Microsoft/Data/SqlClient/TdsParser.cs | 5 ++--- .../Data/SqlClient/TdsParserStateObject.cs | 2 +- .../Data/SqlClient/TdsParserStateObjectNative.cs | 1 + .../Data/SqlClient/TdsParserStateObject.cs | 2 -- .../Data/Common/DbConnectionOptions.Common.cs | 6 ------ .../Data/Common/DbConnectionStringCommon.cs | 1 + .../Data/SqlClient/SqlConnectionString.cs | 1 - 13 files changed, 19 insertions(+), 42 deletions(-) diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml index c2bf5ac5df..b5c46b3615 100644 --- a/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml +++ b/doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml @@ -537,7 +537,7 @@ End Module |Current Language

-or-

Language|N/A|Sets the language used for database server warning or error messages.

The language name can be 128 characters or less.| |Data Source

-or-

Server

-or-

Address

-or-

Addr

-or-

Network Address|N/A|The name or network address of the instance of SQL Server to which to connect. The port number can be specified after the server name:

`server=tcp:servername, portnumber`

When specifying a local instance, always use (local). To force a protocol, add one of the following prefixes:

`np:(local), tcp:(local), lpc:(local)`

You can also connect to a LocalDB database as follows:

`server=(localdb)\\myInstance`

For more information about LocalDB, see [SqlClient Support for LocalDB](/sql/connect/ado-net/sql/sqlclient-support-localdb).

**Data Source** must use the TCP format or the Named Pipes format.

TCP format is as follows:

- tcp:\\\
- tcp:\,\

The TCP format must start with the prefix "tcp:" and is followed by the database instance, as specified by a host name and an instance name. This format is not applicable when connecting to Azure SQL Database. TCP is automatically selected for connections to Azure SQL Database when no protocol is specified.

The host name MUST be specified in one of the following ways:

- NetBIOSName
- IPv4Address
- IPv6Address

The instance name is used to resolve to a particular TCP/IP port number on which a database instance is hosted. Alternatively, specifying a TCP/IP port number directly is also allowed. If both instance name and port number are not present, the default database instance is used.

The Named Pipes format is as follows:

- np:\\\\\pipe\\

The Named Pipes format MUST start with the prefix "np:" and is followed by a named pipe name.

The host name MUST be specified in one of the following ways:

- NetBIOSName
- IPv4Address
- IPv6Address

The pipe name is used to identify the database instance to which the .NET application will connect.

If the value of the **Network** key is specified, the prefixes "tcp:" and "np:" should not be specified. **Note:** You can force the use of TCP instead of shared memory, either by prefixing **tcp:** to the server name in the connection string, or by using **localhost**.| |Enclave Attestation Url|N/A|Gets or sets the enclave attestation URL to be used with enclave based Always Encrypted.| -|Encrypt|'false' in v3.1 and older
'true' in v4.0 and newer|When `true`, SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](/sql/connect/ado-net/connection-string-syntax).

When `TrustServerCertificate` is false and `Encrypt` is true, the server name (or IP address) in a SQL Server SSL certificate must exactly match the server name (or IP address) specified in the connection string. Otherwise, the connection attempt will fail. For information about support for certificates whose subject starts with a wildcard character (*), see [Accepted wildcards used by server certificates for server authentication](https://support.microsoft.com/kb/258858).| +|Encrypt|'true' in 4.0 and above

'false' in 3.x and below|When `true`, TLS encryption is used for all data sent between the client and server if the server has a certificate installed. When `strict`, TDS 8.0 TLS encryption is used and the `TrustServerCertificate` setting is ignored and treated as false. Recognized values are `true`, `false`, `yes`, `no` and `strict`. For more information, see [Connection String Syntax](/sql/connect/ado-net/connection-string-syntax).

When `Encrypt` is true or strict and `TrustServerCertificate` is false, the server name (or IP address) in a server's certificate must exactly match the server name (or IP address) specified in the connection string. Otherwise, the connection attempt will fail. For information about support for certificates whose subject starts with a wildcard character (*), see [Accepted wildcards used by server certificates for server authentication](https://support.microsoft.com/kb/258858).| |Enlist|'true'|`true` indicates that the SQL Server connection pooler automatically enlists the connection in the creation thread's current transaction context.| |Failover Partner|N/A|The name of the failover partner server where database mirroring is configured.

If the value of this key is "", then **Initial Catalog** must be present, and its value must not be "".

The server name can be 128 characters or less.

If you specify a failover partner but the failover partner server is not configured for database mirroring and the primary server (specified with the Server keyword) is not available, then the connection will fail.

If you specify a failover partner and the primary server is not configured for database mirroring, the connection to the primary server (specified with the Server keyword) will succeed if the primary server is available.| |Initial Catalog

-or-

Database|N/A|The name of the database.

The database name can be 128 characters or less.| @@ -557,7 +557,7 @@ End Module |Replication|'false'|`true` if replication is supported using the connection.| |Transaction Binding|Implicit Unbind|Controls connection association with an enlisted `System.Transactions` transaction.

Possible values are:

`Transaction Binding=Implicit Unbind;`

`Transaction Binding=Explicit Unbind;`

Implicit Unbind causes the connection to detach from the transaction when it ends. After detaching, additional requests on the connection are performed in autocommit mode. The `System.Transactions.Transaction.Current` property is not checked when executing requests while the transaction is active. After the transaction has ended, additional requests are performed in autocommit mode.

If the system ends the transaction (in the scope of a using block) before the last command completes, it will throw .

Explicit Unbind causes the connection to remain attached to the transaction until the connection is closed or an explicit `SqlConnection.TransactionEnlist(null)` is called. Beginning in .NET Framework 4.0, changes to Implicit Unbind make Explicit Unbind obsolete. An `InvalidOperationException` is thrown if `Transaction.Current` is not the enlisted transaction or if the enlisted transaction is not active.| |Transparent Network IP Resolution

-or-

TransparentNetworkIPResolution|See description.|When the value of this key is set to `true`, the application is required to retrieve all IP addresses for a particular DNS entry and attempt to connect with the first one in the list. If the connection is not established within 0.5 seconds, the application will try to connect to all others in parallel. When the first answers, the application will establish the connection with the respondent IP address.

If the `MultiSubnetFailover` key is set to `true`, `TransparentNetworkIPResolution` is ignored.

If the `Failover Partner` key is set, `TransparentNetworkIPResolution` is ignored.

The value of this key must be `true`, `false`, `yes`, or `no`.

A value of `yes` is treated the same as a value of `true`.

A value of `no` is treated the same as a value of `false`.

The default values are as follows:

  • `false` when:

    • Connecting to Azure SQL Database where the data source ends with:

      • .database.chinacloudapi.cn
      • .database.usgovcloudapi.net
      • .database.cloudapi.de
      • .database.windows.net
    • `Authentication` is 'Active Directory Password' or 'Active Directory Integrated'
  • `true` in all other cases.
| -|Trust Server Certificate

-or-

TrustServerCertificate|'false'|When set to `true`, SSL is used to encrypt the channel when bypassing walking the certificate chain to validate trust. If TrustServerCertificate is set to `true` and Encrypt is set to `false`, the channel is not encrypted. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](/sql/connect/ado-net/connection-string-syntax).| +|Trust Server Certificate

-or-

TrustServerCertificate|'false'|When set to `true`, TLS is used to encrypt the channel when bypassing walking the certificate chain to validate trust. If TrustServerCertificate is set to `true` and Encrypt is set to `false`, the channel is not encrypted. Recognized values are `true`, `false`, `yes`, and `no`. For more information, see [Connection String Syntax](/sql/connect/ado-net/connection-string-syntax).| |Type System Version|N/A|A string value that indicates the type system the application expects. The functionality available to a client application is dependent on the version of SQL Server and the compatibility level of the database. Explicitly setting the type system version that the client application was written for avoids potential problems that could cause an application to break if a different version of SQL Server is used. **Note:** The type system version cannot be set for common language runtime (CLR) code executing in-process in SQL Server. For more information, see [SQL Server Common Language Runtime Integration](/dotnet/framework/data/adonet/sql/sql-server-common-language-runtime-integration).

Possible values are:

`Type System Version=SQL Server 2012;`

`Type System Version=SQL Server 2008;`

`Type System Version=SQL Server 2005;`

`Type System Version=Latest;`

`Type System Version=SQL Server 2012;` specifies that the application will require version 11.0.0.0 of Microsoft.SqlServer.Types.dll. The other `Type System Version` settings will require version 10.0.0.0 of Microsoft.SqlServer.Types.dll.

`Latest` is obsolete and should not be used. `Latest` is equivalent to `Type System Version=SQL Server 2008;`.| |User ID

-or-

UID

-or-

User|N/A|The SQL Server login account. Not recommended. To maintain a high level of security, we strongly recommend that you use the `Integrated Security` or `Trusted_Connection` keywords instead. is a more secure way to specify credentials for a connection that uses SQL Server Authentication.

The user ID must be 128 characters or less.| |User Instance|'false'|A value that indicates whether to redirect the connection from the default SQL Server Express instance to a runtime-initiated instance running under the account of the caller.| diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptionOption.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptionOption.xml index 298eea080f..e70ce78062 100644 --- a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptionOption.xml +++ b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionEncryptionOption.xml @@ -3,27 +3,28 @@ + Note that these settings cannot be used to bypass encryption and gain access to plaintext data. For details, see Always Encrypted (Database Engine). To be added. - Specifies the connection does not use Always Encrypted. Should be used if no queries sent over the connection access encrypted columns. + Specifies that TLS encryption is optional when connecting to the server. If the server requires encryption, encryption will be negotiated. - Enables Always Encrypted functionality for the connection. Query parameters that correspond to encrypted columns will be transparently encrypted and query results from encrypted columns will be transparently decrypted. + Specifies that TLS encryption is optional when connecting to the server. If the server requires encryption, encryption will be negotiated. - Enables Always Encrypted functionality for the connection. Query parameters that correspond to encrypted columns will be transparently encrypted and query results from encrypted columns will be transparently decrypted. + Specifies that TLS encryption is optional when connecting to the server. If the server requires encryption, encryption will be negotiated. - Enables Always Encrypted functionality for the connection. Query parameters that correspond to encrypted columns will be transparently encrypted and query results from encrypted columns will be transparently decrypted. + Specifies that TLS encryption is required when connecting to the server. If the server doesn't support encryption, the connection will fail. - Enables Always Encrypted functionality for the connection. Query parameters that correspond to encrypted columns will be transparently encrypted and query results from encrypted columns will be transparently decrypted. + Specifies that TLS encryption is required when connecting to the server. If the server doesn't support encryption, the connection will fail. - Enables Always Encrypted functionality for the connection. Query parameters that correspond to encrypted columns will be transparently encrypted and query results from encrypted columns will be transparently decrypted. + Enables and requires TDS 8.0, TLS encryption to the server. If the server doesn't support TDS 8.0, TLS encryption, the connection will fail. diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml index 72cf7aec1e..a73dfdaa9c 100644 --- a/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml +++ b/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml @@ -410,15 +410,15 @@ If the value of the **Network** key is specified, the prefixes "tcp:" and "np:" The enclave attestation URL. - Gets or sets a Boolean value that indicates whether SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed. - The value of the property, or if none has been supplied. + Gets or sets a value that indicates whether TLS encryption is required for all data sent between the client and server. + The value of the property. [!NOTE] > Starting from **version 4.0**, the default value of the property `Encrypt` is set to `true`. @@ -898,7 +898,7 @@ Database = AdventureWorks ## Remarks This property corresponds to the "Trust Server Certificate" and "TrustServerCertificate" keys within the connection string. - When `Trust Server Certificate` is set to `true`, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. If `Trust Server Certificate` is set to `true` and encryption is enforced by target server, the encryption level specified on the server will be used even if `Encrypt` is set to `false`. The connection will fail otherwise. + When `Trust Server Certificate` is set to `true`, the transport layer will use TLS to encrypt the channel and bypass walking the certificate chain to validate trust. If `Trust Server Certificate` is set to `true` and encryption is enforced by target server, the encryption level specified on the server will be used even if `Encrypt` is set to `false`. The connection will fail otherwise. For more information, see [Encryption Hierarchy](/sql/relational-databases/security/encryption/encryption-hierarchy) and [Using Encryption Without Validation](/sql/relational-databases/native-client/features/using-encryption-without-validation). diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln index d6bb7e62f7..17417b4387 100644 --- a/src/Microsoft.Data.SqlClient.sln +++ b/src/Microsoft.Data.SqlClient.sln @@ -120,7 +120,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.SqlClient", ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnection.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnection.xml ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionAttestationProtocol.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionAttestationProtocol.xml ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionColumnEncryptionSetting.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionColumnEncryptionSetting.xml - SqlConnectionEncryptionOption.xml = SqlConnectionEncryptionOption.xml + ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionEncryptionOption.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionEncryptionOption.xml ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionStringBuilder.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionStringBuilder.xml ..\doc\snippets\Microsoft.Data.SqlClient\SqlCredential.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlCredential.xml ..\doc\snippets\Microsoft.Data.SqlClient\SqlDataAdapter.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlDataAdapter.xml @@ -205,8 +205,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4F3CD363-B1E EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SqlServer.Server", "Microsoft.SqlServer.Server\Microsoft.SqlServer.Server.csproj", "{A314812A-7820-4565-A2A8-ABBE391C11E4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTDSS", "..\TestTDSS\TestTDSS.csproj", "{78129850-6C89-471C-884A-CEDB48A1B15F}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -491,18 +489,6 @@ Global {A314812A-7820-4565-A2A8-ABBE391C11E4}.Release|x64.Build.0 = Release|Any CPU {A314812A-7820-4565-A2A8-ABBE391C11E4}.Release|x86.ActiveCfg = Release|Any CPU {A314812A-7820-4565-A2A8-ABBE391C11E4}.Release|x86.Build.0 = Release|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Debug|x64.ActiveCfg = Debug|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Debug|x64.Build.0 = Debug|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Debug|x86.ActiveCfg = Debug|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Debug|x86.Build.0 = Debug|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Release|Any CPU.Build.0 = Release|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Release|x64.ActiveCfg = Release|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Release|x64.Build.0 = Release|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Release|x86.ActiveCfg = Release|Any CPU - {78129850-6C89-471C-884A-CEDB48A1B15F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs index 0b58a02717..60a9157bc6 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs @@ -384,7 +384,6 @@ public void Remove(SqlBulkCopyColumnOrderHint columnOrderHint) { } public new void RemoveAt(int index) { } } - /// [System.FlagsAttribute] public enum SqlBulkCopyOptions diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNINpHandle.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNINpHandle.cs index 1c95b2fb69..441569cbba 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNINpHandle.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SNI/SNINpHandle.cs @@ -26,7 +26,6 @@ internal sealed class SNINpHandle : SNIPhysicalHandle private readonly string _serverNameIndication; private readonly object _sendSync; private readonly bool _isTDS8; - private Stream _stream; private NamedPipeClientStream _pipeStream; private SslOverTdsStream _sslOverTdsStream; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs index 5164cbd7bd..3921f8951d 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs @@ -86,7 +86,7 @@ internal sealed partial class TdsParser private static EncryptionOptions s_sniSupportedEncryptionOption = TdsParserStateObjectFactory.Singleton.EncryptionOptions; - private EncryptionOptions _encryptionOption = s_sniSupportedEncryptionOption; + private EncryptionOptions _encryptionOption = s_sniSupportedEncryptionOption; private SqlInternalTransaction _currentTransaction; private SqlInternalTransaction _pendingTransaction; // pending transaction for 2005 and beyond. @@ -655,7 +655,6 @@ internal void PutSession(TdsParserStateObject session) } } - private void SendPreLoginHandshake(byte[] instanceName, SqlConnectionEncryptionOption encrypt, bool isTDS8, bool integratedSecurity, bool trustServerCert) { // PreLoginHandshake buffer consists of: @@ -956,7 +955,7 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(SqlConnectionEncryption { _physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByClient(), "", 0)); _physicalStateObj.Dispose(); - // ThrowExceptionAndWarning(_physicalStateObj); + ThrowExceptionAndWarning(_physicalStateObj); } break; diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs index 25396ea2e4..78fe4ab4d2 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs @@ -787,7 +787,7 @@ private void ResetCancelAndProcessAttention() } internal abstract void CreatePhysicalSNIHandle(string serverName, bool ignoreSniOpenTimeout, long timerExpire, out byte[] instanceName, ref byte[][] spnBuffer, bool flushCache, bool async, bool fParallel, - SqlConnectionIPAddressPreference iPAddressPreference, string cachedFQDN, ref SQLDNSInfo pendingDNSInfo, bool isIntegratedSecurity = false, bool isTDS8 = false, string hostNameInCertificate = "", string databaseName="", ApplicationIntent applicationIntent =ApplicationIntent.ReadWrite); + SqlConnectionIPAddressPreference iPAddressPreference, string cachedFQDN, ref SQLDNSInfo pendingDNSInfo, bool isIntegratedSecurity = false, bool isTDS8 = false, string hostNameInCertificate = "", string databaseName = "", ApplicationIntent applicationIntent = ApplicationIntent.ReadWrite); internal abstract void AssignPendingDNSInfo(string userProtocol, string DNSCacheKey, ref SQLDNSInfo pendingDNSInfo); diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs index 6c52d99e82..2f0757b3a3 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs @@ -138,6 +138,7 @@ private SNINativeMethodWrapper.ConsumerInfo CreateConsumerInfo(bool async) } internal override void CreatePhysicalSNIHandle(string serverName, bool ignoreSniOpenTimeout, long timerExpire, out byte[] instanceName, ref byte[][] spnBuffer, bool flushCache, bool async, bool fParallel, + SqlConnectionIPAddressPreference ipPreference, string cachedFQDN, ref SQLDNSInfo pendingDNSInfo, bool isIntegratedSecurity, bool isTDS8, string hostNameInCertificate, string databaseName, ApplicationIntent applicationIntent) { // We assume that the loadSSPILibrary has been called already. now allocate proper length of buffer diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs index 2efd51f942..acbad82a6d 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs @@ -88,7 +88,6 @@ internal int ObjectID internal int _inBytesUsed = 0; // number of bytes used in internal read buffer internal int _inBytesRead = 0; // number of bytes read into internal read buffer internal int _inBytesPacket = 0; // number of bytes left in packet - internal int _spid; // SPID of the current connection // Packet state variables @@ -322,7 +321,6 @@ internal TdsParserStateObject(TdsParser parser, SNIHandle physicalConnection, bo SetPacketSize(_parser._physicalStateObj._outBuff.Length); SNINativeMethodWrapper.ConsumerInfo myInfo = CreateConsumerInfo(async); - SQLDNSInfo cachedDNSInfo; bool ret = SQLFallbackDNSCache.Instance.GetDNSInfo(_parser.FQDNforDNSCahce, out cachedDNSInfo); diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionOptions.Common.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionOptions.Common.cs index 91d39082ce..573394c7ac 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionOptions.Common.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionOptions.Common.cs @@ -135,12 +135,6 @@ protected DbConnectionOptions(DbConnectionOptions connectionOptions) internal bool TryGetParsetableValue(string key, out string value) => _parsetable.TryGetValue(key, out value); - //internal SqlConnectionEncryptionOption TryGetSqlConnectionEncryptionValue() - //{ - // return _parsetable.TryGetValue(KEY.Encrypt, out string value) && value != null ? - // ConvertValueToSqlConnectionEncryptionOption(value); - //} - internal SqlConnectionEncryptionOption ConvertValueToSqlConnectionEncryptionOption(string stringValue) { if (CompareInsensitiveInvariant(stringValue, "yes") || CompareInsensitiveInvariant(stringValue, "true") || diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionStringCommon.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionStringCommon.cs index bde8324038..3ab93d2959 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionStringCommon.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/DbConnectionStringCommon.cs @@ -712,6 +712,7 @@ internal static SqlConnectionColumnEncryptionSetting ConvertToColumnEncryptionSe internal static bool TryToConvertToSqlConnectionEncryptionOption(string value, out SqlConnectionEncryptionOption result) { + // SqlConnectionEncryptionOption has length of 3 Debug.Assert(Enum.GetNames(typeof(SqlConnectionEncryptionOption)).Length == 3, "SqlConnectionEncryption enum has changed, update needed. Accepted values are:" + "Optional, false, no, Mandatory, true, yes and Strict"); diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs index d23d8b4ae5..77631b6b2c 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs @@ -91,7 +91,6 @@ internal static class KEY internal const string Current_Language = DbConnectionStringKeywords.CurrentLanguage; internal const string Data_Source = DbConnectionStringKeywords.DataSource; internal const string Encrypt = DbConnectionStringKeywords.Encrypt; - internal const string IsTDS8 = DbConnectionStringKeywords.IsTDS8; internal const string HostNameInCertificate = DbConnectionStringKeywords.HostNameInCertificate; internal const string Enlist = DbConnectionStringKeywords.Enlist;