File tree Expand file tree Collapse file tree 3 files changed +3
-21
lines changed
src/Microsoft.Data.SqlClient
netcore/src/Microsoft/Data/SqlClient
netfx/src/Microsoft/Data/SqlClient
tests/ManualTests/SQL/DataReaderTest Expand file tree Collapse file tree 3 files changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -1454,7 +1454,7 @@ public override DataTable GetSchemaTable()
14541454 Debug . Assert ( null != _metaData . schemaTable , "No schema information yet!" ) ;
14551455 }
14561456 }
1457- return _metaData ? . schemaTable ?? new DataTable ( ) ;
1457+ return _metaData ? . schemaTable ;
14581458 }
14591459 finally
14601460 {
Original file line number Diff line number Diff line change @@ -1681,10 +1681,9 @@ override public DataTable GetSchemaTable()
16811681 {
16821682 _metaData . schemaTable = BuildSchemaTable ( ) ;
16831683 Debug . Assert ( null != _metaData . schemaTable , "No schema information yet!" ) ;
1684- // filter table?
16851684 }
16861685 }
1687- return _metaData ? . schemaTable ?? new DataTable ( ) ;
1686+ return _metaData ? . schemaTable ;
16881687 }
16891688 finally
16901689 {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public static void LoadReaderIntoDataTableToTestGetSchemaTable()
3838 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) ) ]
3939 public static void MultiQuerySchema ( )
4040 {
41+ SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder ( DataTestUtility . TCPConnectionString ) ;
4142 using ( SqlConnection connection = new SqlConnection ( DataTestUtility . TCPConnectionString ) )
4243 {
4344 connection . Open ( ) ;
@@ -66,25 +67,7 @@ public static void MultiQuerySchema()
6667 }
6768 }
6869
69- [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) ) ]
70- public static void GetSchemaTable_returns_null_when_no_resultset ( )
71- {
72- using ( SqlConnection connection = new SqlConnection ( DataTestUtility . TCPConnectionString ) )
73- {
74- connection . Open ( ) ;
7570
76- using ( SqlCommand command = connection . CreateCommand ( ) )
77- {
78- command . CommandText = "SELECT 1" ;
79- using ( SqlDataReader reader = command . ExecuteReader ( ) )
80- {
81- reader . NextResult ( ) ;
82- Assert . NotNull ( reader . GetSchemaTable ( ) ) ;
83- }
84- }
85- }
86- }
87-
8871 // Checks for the IsColumnSet bit in the GetSchemaTable for Sparse columns
8972 [ ConditionalFact ( typeof ( DataTestUtility ) , nameof ( DataTestUtility . AreConnStringsSetup ) ) ]
9073 public static void CheckSparseColumnBit ( )
You can’t perform that action at this time.
0 commit comments