func (e *InsertExec) Close() error {
	e.ctx.GetSessionVars().CurrInsertValues = chunk.Row{}
	if e.SelectExec != nil {
		return e.SelectExec.Close()
	}
	return nil
}
Close implements the Executor Close interface.
package executor
import (
	"context"
	"github.com/pingcap/tidb/kv"
	"github.com/pingcap/tidb/parser/mysql"
	"github.com/pingcap/tidb/types"
	"github.com/pingcap/tidb/util/chunk"
)
type InsertExec struct {
	*InsertValues
	Priority mysql.PriorityEnum
}
func (e *InsertExec) exec(ctx context.Context, rows [][]types.Datum) error {
	sessVars := e.ctx.GetSessionVars()
	defer sessVars.CleanBuffers()
	txn, err := e.ctx.Txn(true)
	if err != nil {
		return err
	}
	sessVars.GetWriteStmtBufs().BufStore = kv.NewBufferStore(txn, kv.TempTxnMemBufCap)
	sessVars.StmtCtx.AddRecordRows(uint64(len(rows)))
	for _, row := range rows {
		if _, err := e.addRecord(ctx, row); err != nil {
			return err
		}
	}
	return nil
}
func (e *InsertExec) Next(ctx context.Context, req *chunk.Chunk) error {
	req.Reset()
	if len(e.children) > 0 && e.children[0] != nil {
		return insertRowsFromSelect(ctx, e)
	}
	return insertRows(ctx, e)
}