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

SQLite Query: Translate Math.Max, Min & Round #10533

Merged
merged 1 commit into from
Dec 12, 2017
Merged

SQLite Query: Translate Math.Max, Min & Round #10533

merged 1 commit into from
Dec 12, 2017

Conversation

bricelam
Copy link
Contributor

Fixes #10526

@bricelam
Copy link
Contributor Author

(There was no direct translation of Min and Max to a Transact-SQL function.)

{ typeof(Math).GetMethod(nameof(Math.Round), new[]{ typeof(decimal), typeof(int) }), "round" }
};

static SqliteMathTranslator()
Copy link
Member

Choose a reason for hiding this comment

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

Add access-level modifier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Invalid syntax. This is a static constructor...

Copy link
Member

Choose a reason for hiding this comment

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

😮


private static void AddSupportedTranslation(Type declaringType, string clrMethodName, string sqlFunctionName)
{
var methodInfos = declaringType.GetTypeInfo().GetDeclaredMethods(clrMethodName);
Copy link
Member

Choose a reason for hiding this comment

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

inline var.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Less readable to me.)

@@ -616,6 +616,22 @@ public virtual void Where_math_sign()
entryCount: 13);
}

[ConditionalFact]
public virtual void Where_math_max()
Copy link
Member

Choose a reason for hiding this comment

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

Can you add SQL Assertions in SqlServer? They would client eval but it would be still good to have it so that we know it actually does not translate fully.

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.

2 participants