Skip to content

Commit

Permalink
Fix bug with LegacyRowVersionNullBehavior
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra committed Jul 22, 2021
1 parent 7f0e3bb commit 8b0e836
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ protected override void Dispose(bool disposing)
}
base.Dispose(disposing);
}
catch(SqlException ex)
catch (SqlException ex)
{
SqlClientEventSource.Log.TryTraceEvent("SqlDataReader.Dispose | ERR | Error Message: {0}, Stack Trace: {1}", ex.Message, ex.StackTrace);
}
Expand Down Expand Up @@ -3775,17 +3775,17 @@ private bool TryReadColumnInternal(int i, bool readHeaderOnly = false)
{
_data[i].SetToNullOfType(SqlBuffer.StorageType.SqlBinary);
}
}
else
{
TdsParser.GetNullSqlValue(_data[_sharedState._nextColumnDataToRead],
columnMetaData,
_command != null ? _command.ColumnEncryptionSetting : SqlCommandColumnEncryptionSetting.UseConnectionSetting,
_parser.Connection);

if (!readHeaderOnly)
else
{
_sharedState._nextColumnDataToRead++;
TdsParser.GetNullSqlValue(_data[_sharedState._nextColumnDataToRead],
columnMetaData,
_command != null ? _command.ColumnEncryptionSetting : SqlCommandColumnEncryptionSetting.UseConnectionSetting,
_parser.Connection);

if (!readHeaderOnly)
{
_sharedState._nextColumnDataToRead++;
}
}
}
}
Expand Down Expand Up @@ -5021,7 +5021,7 @@ override public Task<T> GetFieldValueAsync<T>(int i, CancellationToken cancellat
{
_stateObj._shouldHaveEnoughData = true;
#endif
return Task.FromResult(GetFieldValueInternal<T>(i));
return Task.FromResult(GetFieldValueInternal<T>(i));
#if DEBUG
}
finally
Expand Down Expand Up @@ -5115,7 +5115,7 @@ internal void CompletePendingReadWithFailure(int errorCode, bool resetForcePendi

#endif

internal abstract class SqlDataReaderAsyncCallContext<T> : AAsyncCallContext<SqlDataReader,T>
internal abstract class SqlDataReaderAsyncCallContext<T> : AAsyncCallContext<SqlDataReader, T>
{
internal static readonly Action<Task<T>, object> s_completeCallback = CompleteAsyncCallCallback;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4287,17 +4287,17 @@ private bool TryReadColumnInternal(int i, bool readHeaderOnly = false)
{
_data[i].SetToNullOfType(SqlBuffer.StorageType.SqlBinary);
}
}
else
{
TdsParser.GetNullSqlValue(_data[_sharedState._nextColumnDataToRead],
columnMetaData,
_command != null ? _command.ColumnEncryptionSetting : SqlCommandColumnEncryptionSetting.UseConnectionSetting,
_parser.Connection);

if (!readHeaderOnly)
else
{
_sharedState._nextColumnDataToRead++;
TdsParser.GetNullSqlValue(_data[_sharedState._nextColumnDataToRead],
columnMetaData,
_command != null ? _command.ColumnEncryptionSetting : SqlCommandColumnEncryptionSetting.UseConnectionSetting,
_parser.Connection);

if (!readHeaderOnly)
{
_sharedState._nextColumnDataToRead++;
}
}
}
}
Expand Down

0 comments on commit 8b0e836

Please sign in to comment.