Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0c591e4

Browse files
author
Keerat Singh
committed
Addressed Saurabh's review feedback.
1 parent d57d3d3 commit 0c591e4

File tree

1 file changed

+4
-4
lines changed
  • src/System.Data.SqlClient/src/System/Data/SqlClient

1 file changed

+4
-4
lines changed

src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,17 +2281,17 @@ private bool TryProcessEnvChange(int tokenLength, TdsParserStateObject stateObj,
22812281
{
22822282
return false;
22832283
}
2284+
2285+
// Give the parser the new collation values in case parameters don't specify one
2286+
_defaultCollation = env.newCollation;
22842287

22852288
// UTF8 collation
22862289
if ((env.newCollation.info & TdsEnums.UTF8_IN_TDSCOLLATION) == TdsEnums.UTF8_IN_TDSCOLLATION)
22872290
{
22882291
_defaultEncoding = Encoding.UTF8;
2289-
_defaultCollation = env.newCollation;
22902292
}
22912293
else
22922294
{
2293-
// give the parser the new collation values in case parameters don't specify one
2294-
_defaultCollation = env.newCollation;
22952295
int newCodePage = GetCodePage(env.newCollation, stateObj);
22962296
if (newCodePage != _defaultCodePage)
22972297
{
@@ -3263,7 +3263,7 @@ internal bool TryProcessReturnValue(int length, TdsParserStateObject stateObj, o
32633263
{
32643264
int codePage = GetCodePage(rec.collation, stateObj);
32653265

3266-
// if the column lcid is the same as the default, use the default encoder
3266+
// If the column lcid is the same as the default, use the default encoder
32673267
if (codePage == _defaultCodePage)
32683268
{
32693269
rec.codePage = _defaultCodePage;

0 commit comments

Comments
 (0)