Skip to content
Merged
Show file tree
Hide file tree
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 @@ -97,7 +97,7 @@ public static void ActiveDirectoryDefaultMustPass()
// ActiveIssue tests can be filtered out of test runs on the dotnet CLI
// using the filter "category != failing".
//
[ActiveIssue("https://sqlclientdrivers.visualstudio.com/ADO.Net/_workitems/edit/40107")]
[ActiveIssue("https://sqlclientdrivers.visualstudio.com/ADO.Net/_workitems/edit/45941")]
[ConditionalFact(
typeof(Config),
nameof(Config.SupportsIntegratedSecurity),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ public override void EnlistTransaction(Transaction transaction)
ValidateConnectionForExecute(null);

// If a connection has a local transaction outstanding, and you try to enlist in a DTC
// transaction, SQL Server will roll back the local transaction and then enlist (7.0 and
// 2000). So, if the user tries to do this, throw.
// transaction, SQL Server will roll back the local transaction and then enlist.
// So, if the user tries to do this, throw.
if (HasLocalTransaction)
{
throw ADP.LocalTransactionPresent();
Expand All @@ -841,12 +841,9 @@ public override void EnlistTransaction(Transaction transaction)
return;
}

// If a connection is already enlisted in a DTC transaction, and you try to enlist in
// another one, in 7.0 the existing DTC transaction would roll back and then the
// connection would enlist in the new one. In SQL 2000 & 2005, when you enlist in a DTC
// transaction while the connection is already enlisted in a DTC transaction, the
// connection simply switches enlistments. Regardless, simply enlist in the user
// specified distributed transaction. This behavior matches OLEDB and ODBC.
// If a connection is already enlisted in a DTC transaction and you try to enlist in
// another one, the connection simply switches enlistments. This behavior matches
// OLEDB and ODBC.

Enlist(transaction);
// @TODO: CER Exception Handling was removed here (see GH#3581)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,22 @@ internal sealed partial class SqlConnectionOptions

internal enum TypeSystem
{
Latest = 2008,
SQLServer2000 = 2000,
SQLServer2005 = 2005,
SQLServer2008 = 2008,
SQLServer2012 = 2012,
}

internal static class TYPESYSTEMVERSION
{
// "Latest" is accepted as a connection string value so that applications can
// explicitly opt in to (and the driver can default to) a stable, well-known type
// system rather than having type behavior shift as new SQL Server versions appear.
//
// NOTE: The name "Latest" is misleading and has nothing to do with which type system
// it maps to - it is NOT the newest type system available. It is simply a badly named
// sentinel value that the connection string accepts for historical/compatibility
// reasons. The actual type system it resolves to is decided where "Latest" is parsed.
internal const string Latest = "Latest";
internal const string SQL_Server_2000 = "SQL Server 2000";
internal const string SQL_Server_2005 = "SQL Server 2005";
internal const string SQL_Server_2008 = "SQL Server 2008";
internal const string SQL_Server_2012 = "SQL Server 2012";
Expand Down Expand Up @@ -459,11 +464,12 @@ internal SqlConnectionOptions(string connectionString)

if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.Latest, StringComparison.OrdinalIgnoreCase))
{
_typeSystemVersion = TypeSystem.Latest;
}
else if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.SQL_Server_2000, StringComparison.OrdinalIgnoreCase))
{
_typeSystemVersion = TypeSystem.SQLServer2000;
// "Latest" (and the default when no version is specified) intentionally maps to
Comment thread
paulmedynski marked this conversation as resolved.
// SQL Server 2008 rather than the newest defined type system. Advancing it would
// alter type mappings (e.g. the Microsoft.SqlServer.Types assembly version and how
// down-level types are surfaced) for existing applications that rely on the default,
// which would be a breaking change. Newer type systems must be requested explicitly.
_typeSystemVersion = TypeSystem.SQLServer2008;
}
else if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.SQL_Server_2005, StringComparison.OrdinalIgnoreCase))
{
Expand Down
Loading
Loading