From 45ec02312ea88cd21673ed7dc5f9e1e59f51bcfe Mon Sep 17 00:00:00 2001 From: Cheena Malhotra Date: Tue, 2 Mar 2021 10:55:11 -0800 Subject: [PATCH 1/2] [Release 2.1] Fix Trace String bug --- .../netcore/src/Microsoft/Data/SqlClient/TdsParser.cs | 1 - .../netfx/src/Microsoft/Data/SqlClient/TdsParser.cs | 1 - 2 files changed, 2 deletions(-) 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 7abe7e9582..a0336e060e 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 @@ -12797,7 +12797,6 @@ internal string TraceString() _defaultCodePage, _defaultLCID, TraceObjectClass(_defaultEncoding), - "", _encryptionOption, null == _currentTransaction ? "(null)" : _currentTransaction.TraceString(), null == _pendingTransaction ? "(null)" : _pendingTransaction.TraceString(), diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs index d38633b3c9..226c349eee 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs @@ -13701,7 +13701,6 @@ internal string TraceString() _defaultCodePage, _defaultLCID, TraceObjectClass(_defaultEncoding), - "", _encryptionOption, null == _currentTransaction ? "(null)" : _currentTransaction.TraceString(), null == _pendingTransaction ? "(null)" : _pendingTransaction.TraceString(), From d90bfb9dc488e2ada0b71c2820b8da1c8e3ebc57 Mon Sep 17 00:00:00 2001 From: Cheena Malhotra Date: Tue, 2 Mar 2021 11:43:20 -0800 Subject: [PATCH 2/2] Fix + review feedback --- .../src/Microsoft/Data/SqlClient/TdsParser.cs | 4 +- .../src/Microsoft/Data/SqlClient/TdsParser.cs | 44 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) 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 a0336e060e..7dc08741d1 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 @@ -12788,8 +12788,8 @@ internal string TraceString() { return string.Format(/*IFormatProvider*/ null, StateTraceFormatString, - null == _physicalStateObj ? bool.TrueString : bool.FalseString, - null == _pMarsPhysicalConObj ? bool.TrueString : bool.FalseString, + null == _physicalStateObj ? "(null)" : _physicalStateObj.ObjectID.ToString((IFormatProvider)null), + null == _pMarsPhysicalConObj ? "(null)" : _pMarsPhysicalConObj.ObjectID.ToString((IFormatProvider)null), _state, _server, _fResetConnection ? bool.TrueString : bool.FalseString, diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs index 226c349eee..449a5d7e02 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs @@ -13667,33 +13667,33 @@ internal ulong PlpBytesTotalLength(TdsParserStateObject stateObj) + " _defaultCodePage = {6}\n\t" + " _defaultLCID = {7}\n\t" + " _defaultEncoding = {8}\n\t" - + " _encryptionOption = {10}\n\t" - + " _currentTransaction = {11}\n\t" - + " _pendingTransaction = {12}\n\t" - + " _retainedTransactionId = {13}\n\t" - + " _nonTransactedOpenResultCount = {14}\n\t" - + " _connHandler = {15}\n\t" - + " _fMARS = {16}\n\t" - + " _sessionPool = {17}\n\t" - + " _isShiloh = {18}\n\t" - + " _isShilohSP1 = {19}\n\t" - + " _isYukon = {20}\n\t" - + " _sniSpnBuffer = {21}\n\t" - + " _errors = {22}\n\t" - + " _warnings = {23}\n\t" - + " _attentionErrors = {24}\n\t" - + " _attentionWarnings = {25}\n\t" - + " _statistics = {26}\n\t" - + " _statisticsIsInTransaction = {27}\n\t" - + " _fPreserveTransaction = {28}" - + " _fParallel = {29}" + + " _encryptionOption = {9}\n\t" + + " _currentTransaction = {10}\n\t" + + " _pendingTransaction = {11}\n\t" + + " _retainedTransactionId = {12}\n\t" + + " _nonTransactedOpenResultCount = {13}\n\t" + + " _connHandler = {14}\n\t" + + " _fMARS = {15}\n\t" + + " _sessionPool = {16}\n\t" + + " _isShiloh = {17}\n\t" + + " _isShilohSP1 = {18}\n\t" + + " _isYukon = {19}\n\t" + + " _sniSpnBuffer = {20}\n\t" + + " _errors = {21}\n\t" + + " _warnings = {22}\n\t" + + " _attentionErrors = {23}\n\t" + + " _attentionWarnings = {24}\n\t" + + " _statistics = {25}\n\t" + + " _statisticsIsInTransaction = {26}\n\t" + + " _fPreserveTransaction = {27}" + + " _fParallel = {28}" ; internal string TraceString() { return string.Format(/*IFormatProvider*/ null, StateTraceFormatString, - null == _physicalStateObj ? bool.TrueString : bool.FalseString, - null == _pMarsPhysicalConObj ? bool.TrueString : bool.FalseString, + null == _physicalStateObj ? "(null)" : _physicalStateObj.ObjectID.ToString((IFormatProvider)null), + null == _pMarsPhysicalConObj ? "(null)" : _pMarsPhysicalConObj.ObjectID.ToString((IFormatProvider)null), _state, _server, _fResetConnection ? bool.TrueString : bool.FalseString,