Skip to content

Commit 1027461

Browse files
committed
reverset GetCommand unification and call GetOptionsResetString manually
1 parent 1731b08 commit 1027461

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ private void BuildExecuteSql(
463463
SqlParameter sqlParam;
464464

465465
// @batch_text
466-
string text = GetCommandText(behavior);
466+
string text = GetCommandText(behavior) + GetOptionsResetString(behavior);
467467
sqlParam = rpc.systemParams[0];
468468
sqlParam.SqlDbType = (text.Length << 1) <= TdsEnums.TYPE_SIZE_LIMIT
469469
? SqlDbType.NVarChar
@@ -1383,7 +1383,7 @@ private SqlDataReader RunExecuteReaderTds(
13831383
$"Command Text '{CommandText}'");
13841384
}
13851385

1386-
string text = GetCommandText(cmdBehavior);
1386+
string text = GetCommandText(cmdBehavior) + GetOptionsResetString(cmdBehavior);
13871387

13881388
// If the query requires enclave computations, pass the enclave package in the
13891389
// SqlBatch TDS stream

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2566,7 +2566,7 @@ private string GetCommandText(CommandBehavior behavior)
25662566
// to the sproc.
25672567
Debug.Assert(CommandType is CommandType.Text,
25682568
"invalid call to GetCommandText for stored proc!");
2569-
return GetOptionsSetString(behavior) + CommandText + GetOptionsResetString(behavior);
2569+
return GetOptionsSetString(behavior) + CommandText;
25702570
}
25712571

25722572
private SqlParameterCollection GetCurrentParameterCollection()

0 commit comments

Comments
 (0)