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

Refactored DefaultIfEmptyContext usage. #4554

Merged
merged 5 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed found regressions.
  • Loading branch information
sdanyliv committed Jul 2, 2024
commit 3ddf0c3f93ae4e721999c29fb1e4f27152a22340
6 changes: 4 additions & 2 deletions Source/LinqToDB/Linq/Builder/SelectManyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ protected override BuildSequenceResult BuildMethodCall(ExpressionBuilder builder
if (collectionResult.BuildContext == null)
return collectionResult;

var collection = collectionResult.BuildContext;
var originalCollection = collectionResult.BuildContext;

var collection = originalCollection;

// DefaultIfEmptyContext wil handle correctly projecting NULL objects
//
Expand Down Expand Up @@ -131,7 +133,7 @@ protected override BuildSequenceResult BuildMethodCall(ExpressionBuilder builder
var join = new SqlFromClause.Join(joinType, collection.SelectQuery, collectionAlias, false, null);
sequence.SelectQuery.From.Tables[0].Joins.Add(join.JoinedTable);

var jhc = SequenceHelper.GetJoinHintContext(collection);
var jhc = SequenceHelper.GetJoinHintContext(originalCollection);
if (jhc != null)
{
join.JoinedTable.SqlQueryExtensions = jhc.Extensions;
Expand Down
2 changes: 1 addition & 1 deletion Source/LinqToDB/SqlProvider/SqlOptimizerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static SqlStatement PrepareStatementForRemoting(this ISqlOptimizer optimi
isAlreadyOptimizedAndConverted: false,
static () => NoopQueryParametersNormalizer.Instance);

var nullability = NullabilityContext.NonQuery;
var nullability = NullabilityContext.GetContext(statement.SelectQuery);

var newStatement = optimizationContext.OptimizeAndConvertAll(statement, nullability);

Expand Down
Loading