@@ -447,7 +447,7 @@ func (e *Engine) QueryWithBindings(ctx *sql.Context, query string, parsed sqlpar
447447 }
448448
449449 var schema sql.Schema
450- iter , schema = finalizeIters (ctx , analyzed , qFlags , iter )
450+ iter , schema = rowexec . FinalizeIters (ctx , analyzed , qFlags , iter )
451451 if err != nil {
452452 clearAutocommitErr := clearAutocommitTransaction (ctx )
453453 if clearAutocommitErr != nil {
@@ -493,7 +493,7 @@ func (e *Engine) PrepQueryPlanForExecution(ctx *sql.Context, _ string, plan sql.
493493 }
494494
495495 var schema sql.Schema
496- iter , schema = finalizeIters (ctx , plan , qFlags , iter )
496+ iter , schema = rowexec . FinalizeIters (ctx , plan , qFlags , iter )
497497 if err != nil {
498498 clearAutocommitErr := clearAutocommitTransaction (ctx )
499499 if clearAutocommitErr != nil {
@@ -852,7 +852,7 @@ func (e *Engine) executeEvent(ctx *sql.Context, dbName, createEventStatement, us
852852 return err
853853 }
854854
855- iter , _ = finalizeIters (ctx , definitionNode , nil , iter )
855+ iter , _ = rowexec . FinalizeIters (ctx , definitionNode , nil , iter )
856856
857857 // Drain the iterate to execute the event body/definition
858858 // NOTE: No row data is returned for an event; we just need to execute the statements
@@ -885,14 +885,3 @@ func findCreateEventNode(planTree sql.Node) (*plan.CreateEvent, error) {
885885
886886 return createEventNode , nil
887887}
888-
889- // finalizeIters applies the final transformations on sql.RowIter before execution.
890- func finalizeIters (ctx * sql.Context , analyzed sql.Node , qFlags * sql.QueryFlags , iter sql.RowIter ) (sql.RowIter , sql.Schema ) {
891- var sch sql.Schema
892- iter , sch = rowexec .AddAccumulatorIter (ctx , iter )
893- iter = rowexec .AddTriggerRollbackIter (ctx , qFlags , iter )
894- iter = rowexec .AddTransactionCommittingIter (qFlags , iter )
895- iter = plan .AddTrackedRowIter (ctx , analyzed , iter )
896- iter = rowexec .AddExpressionCloser (analyzed , iter )
897- return iter , sch
898- }
0 commit comments