Skip to content

Commit

Permalink
Merge remote-tracking branch 'UpStream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
DavoudEshtehari committed Nov 10, 2022
2 parents a463806 + 2a54bc5 commit 8c97958
Show file tree
Hide file tree
Showing 23 changed files with 1,868 additions and 2,322 deletions.
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Microsoft.Data.SqlClient library follows the latest .NET Core support policy for

[View the .NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core)

[View SqlClient Support Policy on Microsoft Documentation](https://docs.microsoft.com/sql/connect/ado-net/sqlclient-driver-support-lifecycle)
View GA released version LTS/Current status and support dates here: [SqlClient Support Policy on Microsoft Documentation](https://docs.microsoft.com/sql/connect/ado-net/sqlclient-driver-support-lifecycle)

## Microsoft.Data.SqlClient release cadence

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParameterSetter.cs">
<Link>Microsoft\Data\SqlClient\TdsParameterSetter.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParserStateObject.cs">
<Link>Microsoft\Data\SqlClient\TdsParserStateObject.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParserStaticMethods.cs">
<Link>Microsoft\Data\SqlClient\TdsParserStaticMethods.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ internal EncryptionOptions EncryptionOptions
}
}

internal bool Is2005OrNewer => true;

internal bool Is2008OrNewer
{
get
Expand Down Expand Up @@ -1327,7 +1329,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, bool calle
// report exception to pending async operation
// before OnConnectionClosed overrides the exception
// due to connection close notification through references
var taskSource = stateObj._networkPacketTaskSource;
TaskCompletionSource<object> taskSource = stateObj._networkPacketTaskSource;
if (taskSource != null)
{
taskSource.TrySetException(ADP.ExceptionWithStackTrace(exception));
Expand All @@ -1337,7 +1339,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, bool calle
if (asyncClose)
{
// Wait until we have the parser lock, then try to close
var connHandler = _connHandler;
SqlInternalConnectionTds connHandler = _connHandler;
Action<Action> wrapCloseAction = closeAction =>
{
Task.Factory.StartNew(() =>
Expand Down Expand Up @@ -2607,7 +2609,7 @@ private bool TryProcessEnvChange(int tokenLength, TdsParserStateObject stateObj,

while (tokenLength > processedLength)
{
var env = new SqlEnvChange();
SqlEnvChange env = new SqlEnvChange();
if (!stateObj.TryReadByte(out env._type))
{
return false;
Expand Down Expand Up @@ -3370,7 +3372,7 @@ private bool TryProcessDataClassification(TdsParserStateObject stateObj, out Sen
{
return false;
}
var labels = new List<Label>(numLabels);
List<Label> labels = new List<Label>(numLabels);
for (ushort i = 0; i < numLabels; i++)
{
if (!TryReadSensitivityLabel(stateObj, out string label, out string id))
Expand All @@ -3385,7 +3387,7 @@ private bool TryProcessDataClassification(TdsParserStateObject stateObj, out Sen
{
return false;
}
var informationTypes = new List<InformationType>(numInformationTypes);
List<InformationType> informationTypes = new List<InformationType>(numInformationTypes);
for (ushort i = 0; i < numInformationTypes; i++)
{
if (!TryReadSensitivityInformationType(stateObj, out string informationType, out string id))
Expand All @@ -3410,15 +3412,15 @@ private bool TryProcessDataClassification(TdsParserStateObject stateObj, out Sen
{
return false;
}
var columnSensitivities = new List<ColumnSensitivity>(numResultColumns);
List<ColumnSensitivity> columnSensitivities = new List<ColumnSensitivity>(numResultColumns);
for (ushort columnNum = 0; columnNum < numResultColumns; columnNum++)
{
// get sensitivity properties for all the different sources which were used in generating the column output
if (!stateObj.TryReadUInt16(out ushort numSources))
{
return false;
}
var sensitivityProperties = new List<SensitivityProperty>(numSources);
List<SensitivityProperty> sensitivityProperties = new List<SensitivityProperty>(numSources);
for (ushort sourceNum = 0; sourceNum < numSources; sourceNum++)
{
// get the label index and then lookup label to use for source
Expand Down Expand Up @@ -4429,7 +4431,7 @@ internal void DrainData(TdsParserStateObject stateObj)
SqlDataReader.SharedState sharedState = stateObj._readerState;
if (sharedState != null && sharedState._dataReady)
{
var metadata = stateObj._cleanupMetaData;
_SqlMetaDataSet metadata = stateObj._cleanupMetaData;
if (stateObj._partialHeaderBytesRead > 0)
{
if (!stateObj.TryProcessHeader())
Expand Down Expand Up @@ -7473,12 +7475,12 @@ private Task WriteEncodingChar(string s, int numChars, int offset, Encoding enco
else
{
#if NETFRAMEWORK || NETSTANDARD2_0
var charData = s.ToCharArray(offset, numChars);
var byteData = encoding.GetBytes(charData, 0, numChars);
char[] charData = s.ToCharArray(offset, numChars);
byte[] byteData = encoding.GetBytes(charData, 0, numChars);
Debug.Assert(byteData != null, "no data from encoding");
return stateObj.WriteByteArray(byteData, byteData.Length, 0, canAccumulate);
#else
var byteData = encoding.GetBytes(s, offset, numChars);
byte[] byteData = encoding.GetBytes(s, offset, numChars);
Debug.Assert(byteData != null, "no data from encoding");
return stateObj.WriteByteArray(byteData, byteData.Length, 0, canAccumulate);
#endif
Expand Down Expand Up @@ -9854,7 +9856,7 @@ private void WriteSmiParameter(SqlParameter param, int paramIndex, bool sendDefa

if (advancedTraceIsOn)
{
var sendDefaultValue = sendDefault ? 1 : 0;
int sendDefaultValue = sendDefault ? 1 : 0;
SqlClientEventSource.Log.TryAdvancedTraceEvent("<sc.TdsParser.WriteSmiParameter|ADV> {0}, Sending parameter '{1}', default flag={2}, metadata:{3}", ObjectID, param.ParameterName, sendDefaultValue, metaData.TraceString(3));
}

Expand Down
Loading

0 comments on commit 8c97958

Please sign in to comment.