-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Boolean in select #4141
Boolean in select #4141
Conversation
4848708
to
2d7604e
Compare
2d7604e
to
176ae22
Compare
@@ -143,7 +143,14 @@ public virtual Expression VisitSelect(SelectExpression selectExpression) | |||
_relationalCommandBuilder.Append(", "); | |||
} | |||
|
|||
VisitJoin(selectExpression.Projection); | |||
var comparisonTransformer = new ProjectionComparisonTransformingVisitor(); | |||
var nullComparisonTransformer = new NullComparisonTransformingVisitor(_parametersValues); |
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.
DRY this up with predicate case below.
5234fd1
to
c1fa3a3
Compare
Updated |
@smitpatel Does this potentially resolve #649? |
@@ -1125,7 +1132,7 @@ protected virtual bool TryGenerateBinaryOperator(ExpressionType op, [NotNull] ou | |||
protected override Exception CreateUnhandledItemException<T>(T unhandledItem, string visitMethod) | |||
=> new NotImplementedException(visitMethod); | |||
|
|||
private class NullComparisonTransformingVisitor : RelinqExpressionVisitor | |||
protected class NullComparisonTransformingVisitor : RelinqExpressionVisitor |
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.
This need to be protected?
c1fa3a3
to
506be17
Compare
#649 is resolved by this at least for projections. Added test for it. |
506be17
to
2837445
Compare
resolves #3703
Issue: SQL does not allow not operation on Boolean type directly. They must be compared with true or false. Fix is to convert unary operations on Boolean type to comparison operation.
resolves #3618
Issue: SQL does not allow comparison operation into projection. They must be wrapped in
Case When Then
block.Fix: Whenever there is comparison operation into projection, convert it to conditional expression.
If comparison operation is inside conditional expression already then do no convert.
Issue: Comparison follows null semantics.
Implementation: While processing
SelectExpression
process the projection accordingly.resolves #649 for projections