Skip to content

Commit 3b8d203

Browse files
committed
Add data ordering to queries
1 parent 0f08c46 commit 3b8d203

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/DataStreamTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ private static void ExecuteXmlReaderTest(string connectionString)
695695
using (SqlConnection conn = new SqlConnection(connectionString))
696696
{
697697
conn.Open();
698-
using (SqlCommand cmd = new SqlCommand("select employeeId, lastname, firstname from employees for xml auto", conn))
698+
using (SqlCommand cmd = new SqlCommand("select employeeId, lastname, firstname from employees order by employeeId asc for xml auto", conn))
699699
{
700700
XmlReader xr;
701701
using (xr = cmd.ExecuteXmlReader())
@@ -724,7 +724,7 @@ private static void ExecuteXmlReaderTest(string connectionString)
724724
}
725725

726726
// use a big result to fill up the pipe and do a partial read
727-
cmd.CommandText = "select * from orders for xml auto";
727+
cmd.CommandText = "select * from orders order by orderid asc for xml auto";
728728
string errorMessage;
729729
using (xr = cmd.ExecuteXmlReader())
730730
{
@@ -768,9 +768,9 @@ private static void ExecuteXmlReaderTest(string connectionString)
768768

769769
// multiple results
770770
cmd.CommandText =
771-
"select orderid from orders where orderid < 10253 for xml auto;" +
772-
"select customerid from customers where customerid < 'ANTON' for xml auto;" +
773-
"select employeeId from employees where employeeid < 3 for xml auto;";
771+
"select orderid from orders where orderid < 10253 order by orderid asc for xml auto;" +
772+
"select customerid from customers where customerid < 'ANTON' order by customerid asc for xml auto;" +
773+
"select employeeId from employees where employeeid < 3 order by employeeid asc for xml auto;";
774774
using (xr = cmd.ExecuteXmlReader())
775775
{
776776
string[] expectedResults =
@@ -909,7 +909,7 @@ private static void SequentialAccess(string connectionString)
909909
}
910910
}
911911

912-
using (SqlCommand cmd = new SqlCommand("select * from employees", conn))
912+
using (SqlCommand cmd = new SqlCommand("select * from employees order by EmployeeID", conn))
913913
{
914914
// test sequential access with partial reads
915915
using (reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess))

0 commit comments

Comments
 (0)