Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved to Shared - SqlParameter #1354

Merged
merged 15 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlObjectPool.cs">
<Link>Microsoft\Data\SqlClient\SqlObjectPool.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameter.cs">
<Link>Microsoft\Data\SqlClient\SqlParameter.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameterCollection.cs">
<Link>Microsoft\Data\SqlClient\SqlParameterCollection.cs</Link>
</Compile>
Expand Down Expand Up @@ -562,7 +565,7 @@
<Compile Include="Microsoft\Data\SqlClient\SNI\SNIStreams.ValueTask.cs" />
<Compile Include="Microsoft\Data\SqlClient\SNI\SslOverTdsStream.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlAuthenticationProviderManager.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.AssemblyLoadContext.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.AssemblyLoadContext.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlDelegatedTransaction.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlDiagnosticListener.NetCoreApp.cs" />
<Compile Include="Microsoft\Data\SqlClient\TdsParser.NetCoreApp.cs" />
Expand Down Expand Up @@ -639,7 +642,6 @@
<Compile Include="Microsoft\Data\SqlClient\SqlDelegatedTransaction.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnection.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlParameter.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlTransaction.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlUtil.cs" />
<Compile Include="Microsoft\Data\SqlClient\TdsParser.cs" />
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1932,4 +1932,10 @@
<data name="SQL_ParameterDirectionInvalidForOptimizedBinding" xml:space="preserve">
<value>Parameter '{0}' cannot have Direction Output or InputOutput when EnableOptimizedParameterBinding is enabled on the parent command.</value>
</data>
<data name="DataCategory_Update" xml:space="preserve">
<value>Update</value>
</data>
<data name="DataCategory_Xml" xml:space="preserve">
<value>XML</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ internal class ResourceNames
{
internal const string DataCategory_Data = @"Data";
internal const string DataCategory_Update = @"Update";
internal const string DataCategory_Xml = @"XML";
internal const string DbCommand_CommandTimeout = @"Time to wait for command to execute.";
internal const string DbConnection_State = @"The ConnectionState indicating whether the connection is open or closed.";
internal const string DataCategory_Fill = @"Fill";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameterCollection.cs">
<Link>Microsoft\Data\SqlClient\SqlParameterCollection.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameter.cs">
<Link>Microsoft\Data\SqlClient\SqlParameter.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlQueryMetadataCache.cs">
<Link>Microsoft\Data\SqlClient\SqlQueryMetadataCache.cs</Link>
</Compile>
Expand Down Expand Up @@ -624,7 +627,6 @@
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnection.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionSmi.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlParameter.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlSequentialStreamSmi.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlSequentialTextReaderSmi.cs" />
<Compile Include="Microsoft\Data\SqlClient\SqlTransaction.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6527,7 +6527,6 @@ private void SetUpRPCParameters(_SqlRPC rpc, int startCount, bool inSchema, SqlP
int paramCount = GetParameterCount(parameters);
int j = startCount;
TdsParser parser = _activeConnection.Parser;
bool is2005OrNewer = parser.Is2005OrNewer;

for (ii = 0; ii < paramCount; ii++)
{
Expand All @@ -6536,7 +6535,7 @@ private void SetUpRPCParameters(_SqlRPC rpc, int startCount, bool inSchema, SqlP

// func will change type to that with a 4 byte length if the type has a two
// byte length and a parameter length > than that expressable in 2 bytes
if ((!parameter.ValidateTypeLengths(is2005OrNewer).IsPlp) && (parameter.Direction != ParameterDirection.Output))
if ((!parameter.ValidateTypeLengths().IsPlp) && (parameter.Direction != ParameterDirection.Output))
{
parameter.FixStreamDataForNonPLP();
}
Expand Down Expand Up @@ -6912,8 +6911,6 @@ internal string BuildParamList(TdsParser parser, SqlParameterCollection paramete
StringBuilder paramList = new StringBuilder();
bool fAddSeparator = false;

bool is2005OrNewer = parser.Is2005OrNewer;

int count = 0;

count = parameters.Count;
Expand Down Expand Up @@ -6963,7 +6960,7 @@ internal string BuildParamList(TdsParser parser, SqlParameterCollection paramete
{
// func will change type to that with a 4 byte length if the type has a two
// byte length and a parameter length > than that expressable in 2 bytes
mt = sqlParam.ValidateTypeLengths(is2005OrNewer);
mt = sqlParam.ValidateTypeLengths();
if ((!mt.IsPlp) && (sqlParam.Direction != ParameterDirection.Output))
{
sqlParam.FixStreamDataForNonPLP();
Expand Down
Loading