Skip to content

Commit

Permalink
Fixed use of SELECT * within CTEs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Nov 15, 2023
1 parent f3bd7f6 commit 2535ab6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlanBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,10 @@ private SelectNode ConvertRecursiveCTEQuery(QueryExpression queryExpression, INo
queryExpression.Accept(cteReplacer);

// Convert the modified query.
var childContext = new NodeCompilationContext(_nodeContext, outerReferences.ToDictionary(kvp => kvp.Value, kvp => anchorSchema.Schema[cteValidator.Name.EscapeIdentifier() + "." + kvp.Key].Type, StringComparer.OrdinalIgnoreCase));
return ConvertSelectStatement(queryExpression, null, null, null, childContext);
var childContext = new NodeCompilationContext(_nodeContext, outerReferences.ToDictionary(kvp => kvp.Value, kvp => anchorSchema.Schema[cteValidator.Name.EscapeIdentifier() + "." + kvp.Key.EscapeIdentifier()].Type, StringComparer.OrdinalIgnoreCase));
var converted = ConvertSelectStatement(queryExpression, null, null, null, childContext);
converted.ExpandWildcardColumns(childContext);
return converted;
}

private IRootExecutionPlanNodeInternal[] ConvertExecuteStatement(ExecuteStatement execute)
Expand Down

0 comments on commit 2535ab6

Please sign in to comment.