Skip to content

Commit 64b611d

Browse files
author
James Cor
committed
clean up and comments
1 parent 25441e0 commit 64b611d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

sql/analyzer/fix_exec_indexes.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,9 @@ func (s *idxScope) visitSelf(n sql.Node) error {
583583
// default nodes can't see lateral join nodes, unless we're in lateral
584584
// join and lateral scopes are promoted to parent status
585585
for _, e := range ne.Expressions() {
586-
// groupConcat is special as it appends results to outer scope row.
586+
// groupConcat is special as it appends results to outer scope row
587+
// we need to account for this extra column in the rows when assigning indexes
588+
// see gms/expression/function/aggregation/group_concat.go:groupConcatBuffer.Update()
587589
if gc, isGc := e.(*aggregation.GroupConcat); isGc {
588590
selExprs := gc.GetSelectExprs()
589591
selScope := &idxScope{}
@@ -748,10 +750,6 @@ func fixExprToScope(e sql.Expression, scopes ...*idxScope) sql.Expression {
748750
// this error for the case of DEFAULT in a `plan.Values`, since we analyze the insert source in isolation (we
749751
// don't have the destination schema, and column references in default values are determined in the build phase)
750752

751-
if e.Name() == "sum(t2.age)" {
752-
print()
753-
}
754-
755753
idx, _ := newScope.getIdxId(e.Id(), e.String())
756754
if idx >= 0 {
757755
return e.WithIndex(idx), transform.NewTree, nil

sql/expression/function/aggregation/group_concat.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ func (g *groupConcatBuffer) Update(ctx *sql.Context, originalRow sql.Row) error
297297

298298
// Append the current value to the end of the row. We want to preserve the row's original structure for
299299
// for sort ordering in the final step.
300-
// TODO: why nil spacer?
301300
g.rows = append(g.rows, append(originalRow, vs))
302301

303302
return nil

0 commit comments

Comments
 (0)