Skip to content

Commit

Permalink
Fixed column name escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Nov 15, 2023
1 parent 7c52cb2 commit f3bd7f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlanBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private void ConvertStatement(TSqlStatement statement, ExecutionPlanOptimizer op

// Capture all CTE fields in the outer references
foreach (var col in anchorSchema.Schema)
recurseLoop.OuterReferences[col.Key.SplitMultiPartIdentifier().Last()] = "@" + _nodeContext.GetExpressionName();
recurseLoop.OuterReferences[col.Key.SplitMultiPartIdentifier().Last().EscapeIdentifier()] = "@" + _nodeContext.GetExpressionName();

if (cteValidator.RecursiveQueries.Count > 1)
{
Expand Down

0 comments on commit f3bd7f6

Please sign in to comment.