@@ -459,8 +459,6 @@ internal void Connect(ServerInfo serverInfo,
459
459
hostNameInCertificate,
460
460
serverCertificateFilename);
461
461
462
- _authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this, _serverSpn);
463
-
464
462
if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status)
465
463
{
466
464
_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj));
@@ -559,8 +557,6 @@ internal void Connect(ServerInfo serverInfo,
559
557
hostNameInCertificate,
560
558
serverCertificateFilename);
561
559
562
- _authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this, _serverSpn);
563
-
564
560
if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status)
565
561
{
566
562
_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj));
@@ -599,6 +595,8 @@ internal void Connect(ServerInfo serverInfo,
599
595
}
600
596
SqlClientEventSource.Log.TryTraceEvent("<sc.TdsParser.Connect|SEC> Prelogin handshake successful");
601
597
598
+ _authenticationProvider?.Initialize(serverInfo, _physicalStateObj, this, _serverSpn);
599
+
602
600
if (_fMARS && marsCapable)
603
601
{
604
602
// if user explicitly disables mars or mars not supported, don't create the session pool
@@ -744,7 +742,7 @@ private void SendPreLoginHandshake(
744
742
745
743
// UNDONE - need to do some length verification to ensure packet does not
746
744
// get too big!!! Not beyond it's max length!
747
-
745
+
748
746
for (int option = (int)PreLoginOptions.VERSION; option < (int)PreLoginOptions.NUMOPT; option++)
749
747
{
750
748
int optionDataSize = 0;
@@ -935,7 +933,7 @@ private PreLoginHandshakeStatus ConsumePreLoginHandshake(
935
933
string serverCertificateFilename)
936
934
{
937
935
// Assign default values
938
- marsCapable = _fMARS;
936
+ marsCapable = _fMARS;
939
937
fedAuthRequired = false;
940
938
Debug.Assert(_physicalStateObj._syncOverAsync, "Should not attempt pends in a synchronous call");
941
939
TdsOperationStatus result = _physicalStateObj.TryReadNetworkPacket();
@@ -2181,7 +2179,7 @@ internal TdsOperationStatus TryRun(RunBehavior runBehavior, SqlCommand cmdHandle
2181
2179
dataStream.BrowseModeInfoConsumed = true;
2182
2180
}
2183
2181
else
2184
- {
2182
+ {
2185
2183
// no dataStream
2186
2184
result = stateObj.TrySkipBytes(tokenLength);
2187
2185
if (result != TdsOperationStatus.Done)
@@ -2195,7 +2193,7 @@ internal TdsOperationStatus TryRun(RunBehavior runBehavior, SqlCommand cmdHandle
2195
2193
case TdsEnums.SQLDONE:
2196
2194
case TdsEnums.SQLDONEPROC:
2197
2195
case TdsEnums.SQLDONEINPROC:
2198
- {
2196
+ {
2199
2197
// RunBehavior can be modified - see SQL BU DT 269516 & 290090
2200
2198
result = TryProcessDone(cmdHandler, dataStream, ref runBehavior, stateObj);
2201
2199
if (result != TdsOperationStatus.Done)
@@ -4122,7 +4120,7 @@ internal TdsOperationStatus TryProcessReturnValue(int length,
4122
4120
{
4123
4121
return result;
4124
4122
}
4125
-
4123
+
4126
4124
byte len;
4127
4125
result = stateObj.TryReadByte(out len);
4128
4126
if (result != TdsOperationStatus.Done)
@@ -4321,7 +4319,7 @@ internal TdsOperationStatus TryProcessReturnValue(int length,
4321
4319
{
4322
4320
return result;
4323
4321
}
4324
-
4322
+
4325
4323
if (rec.collation.IsUTF8)
4326
4324
{ // UTF8 collation
4327
4325
rec.encoding = Encoding.UTF8;
@@ -4776,13 +4774,13 @@ internal TdsOperationStatus TryProcessAltMetaData(int cColumns, TdsParserStateOb
4776
4774
{
4777
4775
// internal meta data class
4778
4776
_SqlMetaData col = altMetaDataSet[i];
4779
-
4777
+
4780
4778
result = stateObj.TryReadByte(out _);
4781
4779
if (result != TdsOperationStatus.Done)
4782
4780
{
4783
4781
return result;
4784
4782
}
4785
-
4783
+
4786
4784
result = stateObj.TryReadUInt16(out _);
4787
4785
if (result != TdsOperationStatus.Done)
4788
4786
{
@@ -5466,7 +5464,7 @@ private TdsOperationStatus TryProcessColInfo(_SqlMetaDataSet columns, SqlDataRea
5466
5464
for (int i = 0; i < columns.Length; i++)
5467
5465
{
5468
5466
_SqlMetaData col = columns[i];
5469
-
5467
+
5470
5468
TdsOperationStatus result = stateObj.TryReadByte(out _);
5471
5469
if (result != TdsOperationStatus.Done)
5472
5470
{
@@ -7386,7 +7384,7 @@ private byte[] SerializeSqlMoney(SqlMoney value, int length, TdsParserStateObjec
7386
7384
7387
7385
private void WriteSqlMoney(SqlMoney value, int length, TdsParserStateObject stateObj)
7388
7386
{
7389
- // UNDONE: can I use SqlMoney.ToInt64()?
7387
+ // UNDONE: can I use SqlMoney.ToInt64()?
7390
7388
int[] bits = decimal.GetBits(value.Value);
7391
7389
7392
7390
// this decimal should be scaled by 10000 (regardless of what the incoming decimal was scaled by)
@@ -9906,7 +9904,7 @@ private Task TDSExecuteRPCAddParameter(TdsParserStateObject stateObj, SqlParamet
9906
9904
9907
9905
WriteUDTMetaData(value, names[0], names[1], names[2], stateObj);
9908
9906
9909
- // UNDONE - re-org to use code below to write value!
9907
+ // UNDONE - re-org to use code below to write value!
9910
9908
if (!isNull)
9911
9909
{
9912
9910
WriteUnsignedLong((ulong)udtVal.Length, stateObj); // PLP length
@@ -12340,7 +12338,7 @@ private Task WriteUnterminatedValue(object value, MetaType type, byte scale, int
12340
12338
case TdsEnums.SQLNVARCHAR:
12341
12339
case TdsEnums.SQLNTEXT:
12342
12340
case TdsEnums.SQLXMLTYPE:
12343
- case TdsEnums.SQLJSON:
12341
+ case TdsEnums.SQLJSON:
12344
12342
{
12345
12343
Debug.Assert(!isDataFeed || (value is TextDataFeed || value is XmlDataFeed), "Value must be a TextReader or XmlReader");
12346
12344
Debug.Assert(isDataFeed || (value is string || value is byte[]), "Value is a byte array or string");
0 commit comments