Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
52102e8
Merge AsyncState class, _cachedAsyncState and CachedAsyncState
benrr101 Sep 4, 2025
e980e0f
Add partial for batch RPC mode methods
benrr101 Sep 11, 2025
9332cf6
Merge:
benrr101 Sep 11, 2025
06ec76e
Merge AddBatchCommand
benrr101 Sep 12, 2025
d47b9d2
Merge SetBatchRPCMode and SetBatchRPCModeReadyToExecute
benrr101 Sep 12, 2025
09d6cc9
Merge ClearBatchCommand (and make it private)
benrr101 Sep 12, 2025
e6b56c2
Merging _RPCList and _currentlyExecutingBatch
benrr101 Sep 12, 2025
54af4d5
Merge DebugForceAsyncWriteDelay
benrr101 Sep 12, 2025
f7b4bd9
Merge MaxRPCNameLength, s_cancelIgnoreFailure, CancelIgnoreFailureCal…
benrr101 Sep 12, 2025
f906eb1
Merge: s_diagnosticListener, _parentOperationStarted, _rpcArrayOf1, _…
benrr101 Sep 12, 2025
5473e48
Merge WriteBeginExecuteEvent and WriteEndExecuteEvent (interted if an…
benrr101 Sep 12, 2025
8aeab64
Merge CheckThrowSNIException (made private, rewritten as ?.), OnConne…
benrr101 Sep 12, 2025
28d7c31
Merge BuildParamList (combine a bunch of StringBuilder.Append into Ap…
benrr101 Sep 12, 2025
c2a3f95
Merge ParseAndQuoteIdentifier and QuoteIdentifier (using netcore vers…
benrr101 Sep 12, 2025
b871633
Merge GetRPCObject
benrr101 Sep 12, 2025
1d34c06
Merge SetUpRPCParameters
benrr101 Sep 15, 2025
32feb5a
Merge ShouldSendParameter, CountSendableParameters (inverted logic), …
benrr101 Sep 15, 2025
7700e4e
Merge GetSetOptionsString (made static, renamed to GetOptionsSetStrin…
benrr101 Sep 15, 2025
29ee4fa
Merging GetParameterForOutputValueExtraction (made static, rewrote to…
benrr101 Sep 15, 2025
a2c2953
Merge ReliablePutStateObject, PutStateObject, GetCurrentParameterColl…
benrr101 Sep 15, 2025
7b94854
Merge GetStateObject
benrr101 Sep 15, 2025
7528548
Merge ValidateCommand, ValidateAsyncCommand
benrr101 Sep 15, 2025
dac10ad
Merge CheckNotificationStateAndAutoEnlist, RegisterForConnectionClose…
benrr101 Sep 15, 2025
96132fa
Merge DeriveParameters, GetParameterDirectionFromOleDbDirection
benrr101 Sep 15, 2025
13eae89
Merge TriggerInternalEndAndRetryIfNecessary and CreateLocalCompletion…
benrr101 Sep 15, 2025
1a881c6
Merge OnStatementCompleted
benrr101 Sep 15, 2025
8f55436
Merge UnquoteProcedureName and UnquoteProcedurePart
benrr101 Sep 17, 2025
c743710
Merge ThrowIfReconnectionHasBeenCanceled (inverted, using conditional…
benrr101 Sep 17, 2025
87cfc4f
Merge WaitForAsyncResults
benrr101 Sep 17, 2025
7a079cf
Merge VerifyEndExecuteState (THE LAST ONE)
benrr101 Sep 17, 2025
0088f9d
Delete pre-merge (and now empty) SqlCommand files
benrr101 Sep 18, 2025
c7c6a77
PR comments from copilot
benrr101 Oct 31, 2025
fd6d1c2
Revert a couple changes on BuildParamList
benrr101 Oct 31, 2025
6e2188e
Found a bug in BuildParamList, rolling back a couple changes that wer…
benrr101 Nov 3, 2025
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 @@ -2148,7 +2148,7 @@ private string BuildParamList(TdsParser parser, SqlParameterCollection parameter
{
// @TODO: Rather than manually add separators, is this something that could be done with a string.Join?
StringBuilder paramList = new StringBuilder();
bool fAddSeparation = false; // @TODO: Drop f prefix
bool fAddSeparator = false; // @TODO: Drop f prefix

int count = parameters.Count;
for (int i = 0; i < count; i++)
Expand All @@ -2164,7 +2164,7 @@ private string BuildParamList(TdsParser parser, SqlParameterCollection parameter
}

// Add separator for the ith parameter
if (fAddSeparation)
if (fAddSeparator)
{
paramList.Append(',');
}
Expand All @@ -2182,7 +2182,7 @@ private string BuildParamList(TdsParser parser, SqlParameterCollection parameter
// if we don't provide a fully qualified name
// @TODO: So ... what's correct? ---^^^
paramList.Append(" ");
if (mt.SqlDbType is SqlDbType.Udt) // @TODO: Switch :)
if (mt.SqlDbType is SqlDbType.Udt) // @TODO: Switch statement :)
{
string fullTypeName = sqlParam.UdtTypeName;
if (string.IsNullOrEmpty(fullTypeName))
Expand Down Expand Up @@ -2218,18 +2218,19 @@ private string BuildParamList(TdsParser parser, SqlParameterCollection parameter
paramList.Append(mt.TypeName);
}

fAddSeparation = true;
fAddSeparator = true;

// @TODO: These seem to be a total hodge-podge of conditions. Can we make a list of categories we're checking and expected behaviors
if (mt.SqlDbType is SqlDbType.Decimal)
{
byte scale = sqlParam.GetActualScale();
byte precision = sqlParam.GetActualPrecision();
if (precision == 0)
{
precision = TdsEnums.DEFAULT_NUMERIC_PRECISION;
}

byte scale = sqlParam.GetActualScale();

paramList.AppendFormat("({0},{1})", precision, scale);
}
else if (mt.IsVarTime)
Expand All @@ -2254,17 +2255,17 @@ and not SqlDbType.Udt
// parser, with it's associated code page.
if (mt.IsAnsiType)
{
object value = sqlParam.GetCoercedValue();
object val = sqlParam.GetCoercedValue();
string s = null;

// Deal with the sql types
if (value is not null && value != DBNull.Value)
if (val is not null && val != DBNull.Value)
{
// @TODO: I swear this can be one line in the if statement...
s = value as string;
s = val as string;
if (s is null)
{
SqlString sval = value is SqlString ? (SqlString)value : SqlString.Null;
SqlString sval = val is SqlString ? (SqlString)val : SqlString.Null;
if (!sval.IsNull)
{
s = sval.Value;
Expand All @@ -2276,7 +2277,7 @@ and not SqlDbType.Udt
{
int actualBytes = parser.GetEncodingCharLength(
value: s,
numChars: sqlParam.GetActualScale(),
numChars: sqlParam.GetActualSize(),
charOffset: sqlParam.Offset,
encoding: null);
if (actualBytes > size)
Expand Down