Skip to content

Commit d027aec

Browse files
author
James Cor
committed
fixing stuff
1 parent 8b674e5 commit d027aec

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,8 @@ func findCreateEventNode(planTree sql.Node) (*plan.CreateEvent, error) {
866866

867867
// finalizeIters applies the final transformations on sql.RowIter before execution.
868868
func finalizeIters(ctx *sql.Context, analyzed sql.Node, qFlags *sql.QueryFlags, iter sql.RowIter) sql.RowIter {
869-
iter = plan.AddTrackedRowIter(ctx, analyzed, iter)
870869
iter = rowexec.AddTransactionCommittingIter(qFlags, iter)
870+
iter = plan.AddTrackedRowIter(ctx, analyzed, iter)
871871
iter = rowexec.AddExpressionCloser(analyzed, iter)
872872
return iter
873873
}

sql/plan/process.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ func shouldSetFoundRows(node sql.Node) bool {
262262
return result
263263
}
264264

265-
// TODO: possible to move to rowexec package?
266265
func AddTrackedRowIter(ctx *sql.Context, node sql.Node, iter sql.RowIter) sql.RowIter {
267266
trackedIter := NewTrackedRowIter(node, iter, nil, func() {
268267
ctx.ProcessList.EndQuery(ctx)

sql/rowexec/transaction_iters.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,12 @@ type TransactionCommittingIter struct {
7474
transactionDatabase string
7575
}
7676

77-
func AddTransactionCommittingIter(qFlags *sql.QueryFlags, child sql.RowIter) sql.RowIter {
77+
func AddTransactionCommittingIter(qFlags *sql.QueryFlags, iter sql.RowIter) sql.RowIter {
7878
// TODO: This is a bit of a hack. Need to figure out better relationship between new transaction node and warnings.
7979
if qFlags != nil && qFlags.IsSet(sql.QFlagShowWarnings) {
80-
return child
80+
return iter
8181
}
82-
// TODO: remove this once trackedRowIter is moved out of planbuilder
83-
// Insert TransactionCommittingIter as child of TrackedRowIter
84-
if trackedRowIter, ok := child.(*plan.TrackedRowIter); ok {
85-
return trackedRowIter.WithChildIter(&TransactionCommittingIter{childIter: trackedRowIter.GetIter()})
86-
}
87-
return &TransactionCommittingIter{childIter: child}
82+
return &TransactionCommittingIter{childIter: iter}
8883
}
8984

9085
func (t *TransactionCommittingIter) Next(ctx *sql.Context) (sql.Row, error) {

0 commit comments

Comments
 (0)