Skip to content

Commit

Permalink
Moved to Shared - SqlParameter (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaur-Parminder authored Jun 3, 2022
1 parent 73aa0da commit d0c5c26
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 2,474 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,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 @@ -565,7 +568,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 @@ -642,7 +645,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 @@ -494,6 +494,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 @@ -627,7 +630,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 @@ -6528,7 +6528,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 @@ -6537,7 +6536,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 @@ -6925,8 +6924,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 @@ -6976,7 +6973,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

0 comments on commit d0c5c26

Please sign in to comment.