-
Notifications
You must be signed in to change notification settings - Fork 455
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
Refactoring LINQ Query parsing. #3401
Conversation
e575f75
to
9fcf65f
Compare
@@ -188,7 +188,64 @@ public static TransformVisitor<TContext> Create(TContext context, Func<TContext, | |||
|
|||
// ReSharper disable once InconsistentNaming | |||
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the size of the new implementation of this method, I think you want to remove the AggressiveInlining
hint.
var alias = GetTableAlias(table); | ||
if (alias == null) | ||
{ | ||
throw new InvalidOperationException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have an exception message here.
Source/LinqToDB/DataProvider/SqlServer/SqlServerSqlOptimizer.cs
Outdated
Show resolved
Hide resolved
case ExpressionType.ArrayLength: | ||
{ | ||
//TODO: WTF? | ||
throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WTF? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope some test will pass this line. Extracted and removed code from some previous expression transformation code.
var currentRef = SequenceHelper.EnsureType(rootReference, onType); | ||
var member = currentRef.Type.GetMemberEx(discriminatorMemberInfo); | ||
member = discriminatorMemberInfo; | ||
if (false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: unreachable code
@@ -12,6 +12,11 @@ internal static class TaskCache | |||
public static readonly Task<int> Zero = Task.FromResult(0); | |||
public static readonly Task<int> MinusOne = Task.FromResult(-1); | |||
|
|||
#if NET45 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be gone before release as we will bump lowest supported NETFX version from 4.5 to 4.6.2
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
default : | ||
var predicate = ConvertPredicate(context, expression); | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Three commented sections to leave/remove/etc.
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
}; | ||
var prevSequence = (LoadWithContext)sequence; | ||
if (prevSequence.LastLoadWithInfo == null) | ||
throw new InvalidOperationException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error message? (x2 more on L142 and L161)
{ | ||
var root = Builder.GetRootObject(expression); | ||
if (OutputExpression == null || OutputContext == null) | ||
throw new InvalidOperationException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error message?
Sequence[2].SelectQuery = Sequence[0].SelectQuery; | ||
} | ||
if (targetKeySelector == null || sourceKeySelector == null) | ||
throw new InvalidOperationException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error message? (and L162, L192)
return methodCall.Arguments[idx].UnwrapLambda(); | ||
} | ||
|
||
//TODO: I don't like this. Hints are like mess. Quick workaround before review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to address the TODO?
var targetCloned = cloningContext.CloneContext(TargetContextRef.BuildContext); | ||
|
||
if (ConnectionLambda == null) | ||
throw new InvalidOperationException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error message? (and L333)
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
* [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / SQL Server EXTRAS] baselines * [Linux / Oracle 23c] baselines * [Linux / SQL Server 2019] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / SQL Server EXTRAS] baselines * [Linux / SQL Server 2019] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / SQL Server EXTRAS] baselines * [Linux / SQL Server 2019] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / SQL Server EXTRAS] baselines * [Linux / SQL Server 2019] baselines * [Windows / Access MDB (Jet/ODBC)] baselines * [Windows / Access ACE (OLEDB/ODBC) x86] baselines * [Windows / SQL Server EXTRAS] baselines * [Linux / SQL Server 2019] baselines --------- Co-authored-by: Azure Pipelines Bot <[email protected]>
Well, trying to simplify things and avoid any workarounds.
List of fixed issues (incomplete)
Tasks todo:
DataContext
instance in cache.New features:
GetTable
call forTableFunctionAtrribute
-TableFromExpression
Instead of:
Breaking changes: