From 84ad70d8cfff36c3792c9561870d4e04492d3deb Mon Sep 17 00:00:00 2001 From: Cheena Malhotra Date: Mon, 23 Dec 2019 17:32:05 -0800 Subject: [PATCH] Edits --- .../netcore/src/Microsoft/Data/SqlClient/SqlCommandSet.cs | 4 ++-- .../netfx/src/Microsoft/Data/SqlClient/SqlCommandSet.cs | 4 ++-- .../tests/ManualTests/SQL/SqlCommand/SqlCommandSetTest.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommandSet.cs b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommandSet.cs index 65e92f0098..4d51c01f86 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommandSet.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommandSet.cs @@ -153,9 +153,9 @@ internal void Append(SqlCommand command) if (null != byteValues) { int offset = p.Offset; - int size = p.GetActualSize(); + int size = p.Size; int countOfBytes = byteValues.Length - offset; - if ((0 != size) && (size < countOfBytes)) + if ((size > 0) && (size < countOfBytes)) { countOfBytes = size; } diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommandSet.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommandSet.cs index 733e5861ea..d47f33ed67 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommandSet.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommandSet.cs @@ -180,9 +180,9 @@ internal void Append(SqlCommand command) if (null != byteValues) { int offset = p.Offset; - int size = p.GetActualSize(); + int size = p.Size; int countOfBytes = byteValues.Length - offset; - if ((0 != size) && (size < countOfBytes)) + if ((size > 0) && (size < countOfBytes)) { countOfBytes = size; } diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandSetTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandSetTest.cs index 57b09f08bd..6d6484de3d 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandSetTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandSetTest.cs @@ -14,8 +14,8 @@ public class SqlCommandSetTest [CheckConnStrSetupFact] public void TestByteArrayParameters() { - string tableName = DataTestUtility.GetUniqueName("CMD"); - string procName = DataTestUtility.GetUniqueName("CMD"); + string tableName = DataTestUtility.GetUniqueNameForSqlServer("CMD"); + string procName = DataTestUtility.GetUniqueNameForSqlServer("CMD"); byte[] bArray = new byte[] { 1, 2, 3 }; using (var connection = new SqlConnection(DataTestUtility.TCPConnectionString))