Skip to content

Commit 89d5b8c

Browse files
authored
Merge | SqlDataReader (#3259)
* Merge SqlDataReader contents between netfx and netcore Also handle the TdsParserStateObject.Cancel method. * Merge SqlDataReader.cs * Mop-up debug assertion and comments in TdsParserStateObject
1 parent 61e2317 commit 89d5b8c

File tree

7 files changed

+134
-6381
lines changed

7 files changed

+134
-6381
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@
512512
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlDataAdapter.cs">
513513
<Link>Microsoft\Data\SqlClient\SqlDataAdapter.cs</Link>
514514
</Compile>
515+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlDataReader.cs">
516+
<Link>Microsoft\Data\SqlClient\SqlDataReader.cs</Link>
517+
</Compile>
515518
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlDbColumn.cs">
516519
<Link>Microsoft\Data\SqlClient\SqlDbColumn.cs</Link>
517520
</Compile>
@@ -733,7 +736,6 @@
733736
<Compile Include="Microsoft\Data\SqlClient\SqlConnection.cs" />
734737
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.cs" />
735738
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionHelper.cs" />
736-
<Compile Include="Microsoft\Data\SqlClient\SqlDataReader.cs" />
737739
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />
738740
<Compile Include="Microsoft\Data\SqlClient\TdsParser.cs" />
739741
<Compile Include="Microsoft\Data\SqlClient\TdsParser.netcore.cs" />

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,9 @@
690690
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlDataAdapter.cs">
691691
<Link>Microsoft\Data\SqlClient\SqlDataAdapter.cs</Link>
692692
</Compile>
693+
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlDataReader.cs">
694+
<Link>Microsoft\Data\SqlClient\SqlDataReader.cs</Link>
695+
</Compile>
693696
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SqlDbColumn.cs">
694697
<Link>Microsoft\Data\SqlClient\SqlDbColumn.cs</Link>
695698
</Compile>
@@ -890,7 +893,6 @@
890893
<Compile Include="Microsoft\Data\SqlClient\SqlConnection.cs" />
891894
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.cs" />
892895
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionHelper.cs" />
893-
<Compile Include="Microsoft\Data\SqlClient\SqlDataReader.cs" />
894896
<Compile Include="Microsoft\Data\SqlClient\SqlDataReaderSmi.cs" />
895897
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionSmi.cs" />
896898
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,7 @@ private void WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletio
30603060
{
30613061
_stateObj = _parser.GetSession(this);
30623062
_stateObj._bulkCopyOpperationInProgress = true;
3063-
_stateObj.StartSession(ObjectID);
3063+
_stateObj.StartSession(this);
30643064
}
30653065
finally
30663066
{

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,14 +1234,14 @@ public override void Cancel()
12341234
TdsParserStateObject stateObj = _stateObj;
12351235
if (stateObj != null)
12361236
{
1237-
stateObj.Cancel(ObjectID);
1237+
stateObj.Cancel(this);
12381238
}
12391239
else
12401240
{
12411241
SqlDataReader reader = connection.FindLiveReader(this);
12421242
if (reader != null)
12431243
{
1244-
reader.Cancel(ObjectID);
1244+
reader.Cancel(this);
12451245
}
12461246
}
12471247
}
@@ -5833,7 +5833,7 @@ private void GetStateObject(TdsParser parser = null)
58335833
}
58345834

58355835
TdsParserStateObject stateObj = parser.GetSession(this);
5836-
stateObj.StartSession(ObjectID);
5836+
stateObj.StartSession(this);
58375837

58385838
_stateObj = stateObj;
58395839

0 commit comments

Comments
 (0)