Skip to content

Conversation

@cincuranet
Copy link
Contributor

Fixes #37185.

{
switch (node)
{
case ValuesExpression valuesExpression when valuesExpression.ValuesParameter is { } valuesParameter:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
case ValuesExpression valuesExpression when valuesExpression.ValuesParameter is { } valuesParameter:
case ValuesExpression { ValuesParameter: { } valuesParameter }:

(and below)

}
else
{
ProcessParameter(sqlParameterExpression);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to take Constants mode into account no? In that case the parameter shouldn't be counted at all (since its contents are fully inlined)

private readonly ISqlServerSingletonOptions _sqlServerSingletonOptions;

private int _openJsonAliasCounter;
private int _parametersCount;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private int _parametersCount;
private int _totalParameterCount;

Count += count;
if (bucketization)
{
var elementTypeMapping = (RelationalTypeMapping)sqlParameterExpression.TypeMapping!.ElementTypeMapping!;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me - we need the type mapping just in case the padding/bucketization needs to work differently depending on the parameter type (e.g. bucketize on int but not on big varbinary)? If so, we don't actually currently do that, do we?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contains fails to fallback to OPENJSON with many parameters in complex queries

2 participants