internal override SqlSource VisitJoin(SqlJoin join) { SqlScope save = this.CurrentScope; switch(join.JoinType) { case SqlJoinType.CrossApply: case SqlJoinType.OuterApply: { this.Visit(join.Left); SqlScope tmp = new SqlScope(join.Left, this.CurrentScope.ContainingScope); this.CurrentScope = new SqlScope(null, tmp); this.Visit(join.Right); SqlScope tmp2 = new SqlScope(join.Right, tmp); this.CurrentScope = new SqlScope(null, tmp2); this.Visit(join.Condition); break; } default: { this.Visit(join.Left); this.Visit(join.Right); this.CurrentScope = new SqlScope(null, new SqlScope(join.Right, new SqlScope(join.Left, this.CurrentScope.ContainingScope))); this.Visit(join.Condition); break; } } this.CurrentScope = save; return join; }
private SqlColumnRef BubbleUp(SqlColumnRef cref) { for (SqlScope s = this.CurrentScope; s != null; s = s.ContainingScope) { if (s.Source != null) { SqlColumn found = this.bubbler.BubbleUp(cref.Column, s.Source); if (found != null) { if (found != cref.Column) { return(new SqlColumnRef(found)); } return(cref); } } } return(null); }
internal SqlScope(SqlNode source, SqlScope containing) { this.source = source; this.containing = containing; }
internal SqlScope(SqlNode source, SqlScope containing) { this.source = source; this.containing = containing; }