@@ -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 , err = finalizeIters (ctx , analyzed , qFlags , iter )
450+ iter , schema = 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 , err = finalizeIters (ctx , plan , qFlags , iter )
496+ iter , schema = finalizeIters (ctx , plan , qFlags , iter )
497497 if err != nil {
498498 clearAutocommitErr := clearAutocommitTransaction (ctx )
499499 if clearAutocommitErr != nil {
@@ -852,14 +852,7 @@ func (e *Engine) executeEvent(ctx *sql.Context, dbName, createEventStatement, us
852852 return err
853853 }
854854
855- iter , _ , err = finalizeIters (ctx , definitionNode , nil , iter )
856- if err != nil {
857- clearAutocommitErr := clearAutocommitTransaction (ctx )
858- if clearAutocommitErr != nil {
859- return clearAutocommitErr
860- }
861- return err
862- }
855+ iter , _ = finalizeIters (ctx , definitionNode , nil , iter )
863856
864857 // Drain the iterate to execute the event body/definition
865858 // NOTE: No row data is returned for an event; we just need to execute the statements
@@ -894,17 +887,12 @@ func findCreateEventNode(planTree sql.Node) (*plan.CreateEvent, error) {
894887}
895888
896889// finalizeIters applies the final transformations on sql.RowIter before execution.
897- func finalizeIters (ctx * sql.Context , analyzed sql.Node , qFlags * sql.QueryFlags , iter sql.RowIter ) (sql.RowIter , sql.Schema , error ) {
898- var err error
890+ func finalizeIters (ctx * sql.Context , analyzed sql.Node , qFlags * sql.QueryFlags , iter sql.RowIter ) (sql.RowIter , sql.Schema ) {
899891 var sch sql.Schema
900- // TODO: if this is does something we need to overwrite the schema with types.OkResultSchema
901- iter , sch , err = rowexec .AddAccumulatorIter (ctx , iter )
902- if err != nil {
903- return nil , nil , err
904- }
892+ iter , sch = rowexec .AddAccumulatorIter (ctx , iter )
905893 iter = rowexec .AddTriggerRollbackIter (ctx , qFlags , iter )
906894 iter = rowexec .AddTransactionCommittingIter (qFlags , iter )
907895 iter = plan .AddTrackedRowIter (ctx , analyzed , iter )
908896 iter = rowexec .AddExpressionCloser (analyzed , iter )
909- return iter , sch , nil
897+ return iter , sch
910898}
0 commit comments