tidb: github.com/pingcap/tidb/executor Index | Files | Directories

package executor

import "github.com/pingcap/tidb/executor"

Index

Package Files

adapter.go admin.go admin_plugins.go aggregate.go analyze.go batch_checker.go batch_point_get.go bind.go builder.go change.go checksum.go compiler.go ddl.go delete.go distsql.go errors.go executor.go explain.go grant.go hash_table.go index_lookup_hash_join.go index_lookup_join.go insert.go insert_common.go join.go joiner.go load_data.go load_stats.go mem_reader.go merge_join.go opt_rule_blacklist.go point_get.go prepared.go projection.go reload_expr_pushdown_blacklist.go replace.go revoke.go set.go show.go show_stats.go simple.go sort.go split.go table_reader.go trace.go union_scan.go update.go window.go write.go

Constants

const LoadDataVarKey loadDataVarKeyType = 0

LoadDataVarKey is a variable key for load data.

const LoadStatsVarKey loadStatsVarKeyType = 0

LoadStatsVarKey is a variable key for load statistic.

Variables

var (
    ErrGetStartTS      = terror.ClassExecutor.New(codeGetStartTS, "Can not get start ts")
    ErrUnknownPlan     = terror.ClassExecutor.New(codeUnknownPlan, "Unknown plan")
    ErrPrepareMulti    = terror.ClassExecutor.New(codePrepareMulti, "Can not prepare multiple statements")
    ErrPrepareDDL      = terror.ClassExecutor.New(codePrepareDDL, "Can not prepare DDL statements with parameters")
    ErrResultIsEmpty   = terror.ClassExecutor.New(codeResultIsEmpty, "result is empty")
    ErrBuildExecutor   = terror.ClassExecutor.New(codeErrBuildExec, "Failed to build executor")
    ErrBatchInsertFail = terror.ClassExecutor.New(codeBatchInsertFail, "Batch insert failed, please clean the table and try again.")

    ErrCantCreateUserWithGrant     = terror.ClassExecutor.New(mysql.ErrCantCreateUserWithGrant, mysql.MySQLErrName[mysql.ErrCantCreateUserWithGrant])
    ErrPasswordNoMatch             = terror.ClassExecutor.New(mysql.ErrPasswordNoMatch, mysql.MySQLErrName[mysql.ErrPasswordNoMatch])
    ErrCannotUser                  = terror.ClassExecutor.New(mysql.ErrCannotUser, mysql.MySQLErrName[mysql.ErrCannotUser])
    ErrPasswordFormat              = terror.ClassExecutor.New(mysql.ErrPasswordFormat, mysql.MySQLErrName[mysql.ErrPasswordFormat])
    ErrCantChangeTxCharacteristics = terror.ClassExecutor.New(mysql.ErrCantChangeTxCharacteristics, mysql.MySQLErrName[mysql.ErrCantChangeTxCharacteristics])
    ErrPsManyParam                 = terror.ClassExecutor.New(mysql.ErrPsManyParam, mysql.MySQLErrName[mysql.ErrPsManyParam])
    ErrAdminCheckTable             = terror.ClassExecutor.New(mysql.ErrAdminCheckTable, mysql.MySQLErrName[mysql.ErrAdminCheckTable])
    ErrDBaccessDenied              = terror.ClassExecutor.New(mysql.ErrDBaccessDenied, mysql.MySQLErrName[mysql.ErrDBaccessDenied])
    ErrTableaccessDenied           = terror.ClassExecutor.New(mysql.ErrTableaccessDenied, mysql.MySQLErrName[mysql.ErrTableaccessDenied])
    ErrBadDB                       = terror.ClassExecutor.New(mysql.ErrBadDB, mysql.MySQLErrName[mysql.ErrBadDB])
    ErrWrongObject                 = terror.ClassExecutor.New(mysql.ErrWrongObject, mysql.MySQLErrName[mysql.ErrWrongObject])
    ErrRoleNotGranted              = terror.ClassPrivilege.New(mysql.ErrRoleNotGranted, mysql.MySQLErrName[mysql.ErrRoleNotGranted])
    ErrDeadlock                    = terror.ClassExecutor.New(mysql.ErrLockDeadlock, mysql.MySQLErrName[mysql.ErrLockDeadlock])
    ErrQueryInterrupted            = terror.ClassExecutor.New(mysql.ErrQueryInterrupted, mysql.MySQLErrName[mysql.ErrQueryInterrupted])
)

Error instances.

var LookupTableTaskChannelSize int32 = 50

LookupTableTaskChannelSize represents the channel size of the index double read taskChan.

var QueryReplacer = strings.NewReplacer("\r", " ", "\n", " ", "\t", " ")

QueryReplacer replaces new line and tab for grep result including query string.

var (
    // RandSeed is the seed for randing package.
    // It's public for test.
    RandSeed = int64(1)
)

func CompileExecutePreparedStmt Uses

func CompileExecutePreparedStmt(ctx context.Context, sctx sessionctx.Context,
    ID uint32, args []types.Datum) (sqlexec.Statement, error)

CompileExecutePreparedStmt compiles a session Execute command to a stmt.Statement.

func CountStmtNode Uses

func CountStmtNode(stmtNode ast.StmtNode, inRestrictedSQL bool)

CountStmtNode records the number of statements with the same type.

func FormatSQL Uses

func FormatSQL(sql string, sessVars *variable.SessionVars) string

FormatSQL is used to format the original SQL, e.g. truncating long SQL, appending prepared arguments.

func GetInfoSchema Uses

func GetInfoSchema(ctx sessionctx.Context) infoschema.InfoSchema

GetInfoSchema gets TxnCtx InfoSchema if snapshot schema is not set, Otherwise, snapshot schema is returned.

func GetLackHandles Uses

func GetLackHandles(expectedHandles []int64, obtainedHandlesMap map[int64]struct{}) []int64

GetLackHandles gets the handles in expectedHandles but not in obtainedHandlesMap.

func GetStmtLabel Uses

func GetStmtLabel(stmtNode ast.StmtNode) string

GetStmtLabel generates a label for a statement.

func LoadExprPushdownBlacklist Uses

func LoadExprPushdownBlacklist(ctx sessionctx.Context) (err error)

LoadExprPushdownBlacklist loads the latest data from table mysql.expr_pushdown_blacklist.

func LoadOptRuleBlacklist Uses

func LoadOptRuleBlacklist(ctx sessionctx.Context) (err error)

LoadOptRuleBlacklist loads the latest data from table mysql.opt_rule_blacklist.

func Next Uses

func Next(ctx context.Context, e Executor, req *chunk.Chunk) error

Next is a wrapper function on e.Next(), it handles some common codes.

func ResetContextOfStmt Uses

func ResetContextOfStmt(ctx sessionctx.Context, s ast.StmtNode) (err error)

ResetContextOfStmt resets the StmtContext and session variables. Before every execution, we must clear statement context.

type AdminPluginsExec Uses

type AdminPluginsExec struct {
    Action  core.AdminPluginsAction
    Plugins []string
    // contains filtered or unexported fields
}

AdminPluginsExec indicates AdminPlugins executor.

func (*AdminPluginsExec) Close Uses

func (e *AdminPluginsExec) Close() error

Close closes all executors and release all resources.

func (*AdminPluginsExec) Next Uses

func (e *AdminPluginsExec) Next(ctx context.Context, _ *chunk.Chunk) error

Next implements the Executor Next interface.

func (*AdminPluginsExec) Open Uses

func (e *AdminPluginsExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*AdminPluginsExec) Schema Uses

func (e *AdminPluginsExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type AfFinalResult Uses

type AfFinalResult struct {
    // contains filtered or unexported fields
}

AfFinalResult indicates aggregation functions final result.

type AnalyzeColumnsExec Uses

type AnalyzeColumnsExec struct {
    // contains filtered or unexported fields
}

AnalyzeColumnsExec represents Analyze columns push down executor.

type AnalyzeExec Uses

type AnalyzeExec struct {
    // contains filtered or unexported fields
}

AnalyzeExec represents Analyze executor.

func (*AnalyzeExec) Close Uses

func (e *AnalyzeExec) Close() error

Close closes all executors and release all resources.

func (*AnalyzeExec) Next Uses

func (e *AnalyzeExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*AnalyzeExec) Open Uses

func (e *AnalyzeExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*AnalyzeExec) Schema Uses

func (e *AnalyzeExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type AnalyzeFastExec Uses

type AnalyzeFastExec struct {
    // contains filtered or unexported fields
}

AnalyzeFastExec represents Fast Analyze executor.

type AnalyzeFastTask Uses

type AnalyzeFastTask struct {
    Location    *tikv.KeyLocation
    SampSize    uint64
    BeginOffset uint64
    EndOffset   uint64
}

AnalyzeFastTask is the task for build stats.

type AnalyzeIndexExec Uses

type AnalyzeIndexExec struct {
    // contains filtered or unexported fields
}

AnalyzeIndexExec represents analyze index push down executor.

type AnalyzeTestFastExec Uses

type AnalyzeTestFastExec struct {
    AnalyzeFastExec
    Ctx             sessionctx.Context
    PhysicalTableID int64
    PKInfo          *model.ColumnInfo
    ColsInfo        []*model.ColumnInfo
    IdxsInfo        []*model.IndexInfo
    Concurrency     int
    Collectors      []*statistics.SampleCollector
    TblInfo         *model.TableInfo
    Opts            map[ast.AnalyzeOptionType]uint64
}

AnalyzeTestFastExec is for fast sample in unit test.

func (*AnalyzeTestFastExec) TestFastSample Uses

func (e *AnalyzeTestFastExec) TestFastSample() error

TestFastSample only test the fast sample in unit test.

type BatchPointGetExec Uses

type BatchPointGetExec struct {
    // contains filtered or unexported fields
}

BatchPointGetExec executes a bunch of point select queries.

func (*BatchPointGetExec) Close Uses

func (e *BatchPointGetExec) Close() error

Close implements the Executor interface.

func (*BatchPointGetExec) Next Uses

func (e *BatchPointGetExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor interface.

func (*BatchPointGetExec) Open Uses

func (e *BatchPointGetExec) Open(context.Context) error

Open implements the Executor interface.

func (*BatchPointGetExec) Schema Uses

func (e *BatchPointGetExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type CancelDDLJobsExec Uses

type CancelDDLJobsExec struct {
    // contains filtered or unexported fields
}

CancelDDLJobsExec represents a cancel DDL jobs executor.

func (*CancelDDLJobsExec) Close Uses

func (e *CancelDDLJobsExec) Close() error

Close closes all executors and release all resources.

func (*CancelDDLJobsExec) Next Uses

func (e *CancelDDLJobsExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*CancelDDLJobsExec) Open Uses

func (e *CancelDDLJobsExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*CancelDDLJobsExec) Schema Uses

func (e *CancelDDLJobsExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ChangeExec Uses

type ChangeExec struct {
    *ast.ChangeStmt
    // contains filtered or unexported fields
}

ChangeExec represents a change executor.

func (*ChangeExec) Close Uses

func (e *ChangeExec) Close() error

Close closes all executors and release all resources.

func (*ChangeExec) Next Uses

func (e *ChangeExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ChangeExec) Open Uses

func (e *ChangeExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ChangeExec) Schema Uses

func (e *ChangeExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type CheckIndexExec Uses

type CheckIndexExec struct {
    // contains filtered or unexported fields
}

CheckIndexExec represents the executor of checking an index. It is built from the "admin check index" statement, and it checks the consistency of the index data with the records of the table.

func (*CheckIndexExec) Close Uses

func (e *CheckIndexExec) Close() error

Close implements the Executor Close interface.

func (*CheckIndexExec) Next Uses

func (e *CheckIndexExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*CheckIndexExec) Open Uses

func (e *CheckIndexExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*CheckIndexExec) Schema Uses

func (e *CheckIndexExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type CheckIndexRangeExec Uses

type CheckIndexRangeExec struct {
    // contains filtered or unexported fields
}

CheckIndexRangeExec outputs the index values which has handle between begin and end.

func (*CheckIndexRangeExec) Close Uses

func (e *CheckIndexRangeExec) Close() error

Close implements the Executor Close interface.

func (*CheckIndexRangeExec) Next Uses

func (e *CheckIndexRangeExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*CheckIndexRangeExec) Open Uses

func (e *CheckIndexRangeExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*CheckIndexRangeExec) Schema Uses

func (e *CheckIndexRangeExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type CheckTableExec Uses

type CheckTableExec struct {
    // contains filtered or unexported fields
}

CheckTableExec represents a check table executor. It is built from the "admin check table" statement, and it checks if the index matches the records in the table.

func (*CheckTableExec) Close Uses

func (e *CheckTableExec) Close() error

Close implements the Executor Close interface.

func (*CheckTableExec) Next Uses

func (e *CheckTableExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*CheckTableExec) Open Uses

func (e *CheckTableExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*CheckTableExec) Schema Uses

func (e *CheckTableExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ChecksumTableExec Uses

type ChecksumTableExec struct {
    // contains filtered or unexported fields
}

ChecksumTableExec represents ChecksumTable executor.

func (*ChecksumTableExec) Close Uses

func (e *ChecksumTableExec) Close() error

Close closes all executors and release all resources.

func (*ChecksumTableExec) Next Uses

func (e *ChecksumTableExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ChecksumTableExec) Open Uses

func (e *ChecksumTableExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*ChecksumTableExec) Schema Uses

func (e *ChecksumTableExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type CleanupIndexExec Uses

type CleanupIndexExec struct {
    // contains filtered or unexported fields
}

CleanupIndexExec represents a cleanup index executor. It is built from "admin cleanup index" statement, is used to delete dangling index data.

func (*CleanupIndexExec) Close Uses

func (e *CleanupIndexExec) Close() error

Close implements the Executor Close interface.

func (*CleanupIndexExec) Next Uses

func (e *CleanupIndexExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*CleanupIndexExec) Open Uses

func (e *CleanupIndexExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*CleanupIndexExec) Schema Uses

func (e *CleanupIndexExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type Closeable Uses

type Closeable interface {
    // Close closes the object.
    Close() error
}

Closeable is a interface for closeable structures.

type CommitTask Uses

type CommitTask struct {
    // contains filtered or unexported fields
}

CommitTask is used for fetching data from data preparing routine into committing routine.

type Compiler Uses

type Compiler struct {
    Ctx sessionctx.Context
}

Compiler compiles an ast.StmtNode to a physical plan.

func (*Compiler) Compile Uses

func (c *Compiler) Compile(ctx context.Context, stmtNode ast.StmtNode) (*ExecStmt, error)

Compile compiles an ast.StmtNode to a physical plan.

type DDLExec Uses

type DDLExec struct {
    // contains filtered or unexported fields
}

DDLExec represents a DDL executor. It grabs a DDL instance from Domain, calling the DDL methods to do the work.

func (*DDLExec) Close Uses

func (e *DDLExec) Close() error

Close closes all executors and release all resources.

func (*DDLExec) Next Uses

func (e *DDLExec) Next(ctx context.Context, req *chunk.Chunk) (err error)

Next implements the Executor Next interface.

func (*DDLExec) Open Uses

func (e *DDLExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*DDLExec) Schema Uses

func (e *DDLExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type DeallocateExec Uses

type DeallocateExec struct {
    Name string
    // contains filtered or unexported fields
}

DeallocateExec represent a DEALLOCATE executor.

func (*DeallocateExec) Close Uses

func (e *DeallocateExec) Close() error

Close closes all executors and release all resources.

func (*DeallocateExec) Next Uses

func (e *DeallocateExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*DeallocateExec) Open Uses

func (e *DeallocateExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*DeallocateExec) Schema Uses

func (e *DeallocateExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type DeleteExec Uses

type DeleteExec struct {
    IsMultiTable bool
    // contains filtered or unexported fields
}

DeleteExec represents a delete executor. See https://dev.mysql.com/doc/refman/5.7/en/delete.html

func (*DeleteExec) Close Uses

func (e *DeleteExec) Close() error

Close implements the Executor Close interface.

func (*DeleteExec) Next Uses

func (e *DeleteExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*DeleteExec) Open Uses

func (e *DeleteExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*DeleteExec) Schema Uses

func (e *DeleteExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type DirtyDB Uses

type DirtyDB struct {
    // contains filtered or unexported fields
}

DirtyDB stores uncommitted write operations for a transaction. It is stored and retrieved by context.Value and context.SetValue method.

func GetDirtyDB Uses

func GetDirtyDB(ctx sessionctx.Context) *DirtyDB

GetDirtyDB returns the DirtyDB bind to the context.

func (*DirtyDB) GetDirtyTable Uses

func (udb *DirtyDB) GetDirtyTable(tid int64) *DirtyTable

GetDirtyTable gets the DirtyTable by id from the DirtyDB.

type DirtyTable Uses

type DirtyTable struct {
    // contains filtered or unexported fields
}

DirtyTable stores uncommitted write operation for a transaction.

func (*DirtyTable) AddRow Uses

func (dt *DirtyTable) AddRow(handle int64)

AddRow adds a row to the DirtyDB.

func (*DirtyTable) DeleteRow Uses

func (dt *DirtyTable) DeleteRow(handle int64)

DeleteRow deletes a row from the DirtyDB.

type ExecStmt Uses

type ExecStmt struct {
    // InfoSchema stores a reference to the schema information.
    InfoSchema infoschema.InfoSchema
    // Plan stores a reference to the final physical plan.
    Plan plannercore.Plan
    // Text represents the origin query text.
    Text string

    StmtNode ast.StmtNode

    Ctx sessionctx.Context

    // LowerPriority represents whether to lower the execution priority of a query.
    LowerPriority bool
    // Cacheable represents whether the physical plan can be cached.
    Cacheable bool

    // OutputNames will be set if using cached plan
    OutputNames []*types.FieldName
    // contains filtered or unexported fields
}

ExecStmt implements the sqlexec.Statement interface, it builds a planner.Plan to an sqlexec.Statement.

func (*ExecStmt) Exec Uses

func (a *ExecStmt) Exec(ctx context.Context) (_ sqlexec.RecordSet, err error)

Exec builds an Executor from a plan. If the Executor doesn't return result, like the INSERT, UPDATE statements, it executes in this function, if the Executor returns result, execution is done after this function returns, in the returned sqlexec.RecordSet Next method.

func (*ExecStmt) GetPointRecord Uses

func (a *ExecStmt) GetPointRecord(ctx context.Context, is infoschema.InfoSchema) (*recordSet, error)

GetPointRecord short path for point exec directly from plan, keep only necessary steps

func (*ExecStmt) IsPrepared Uses

func (a *ExecStmt) IsPrepared() bool

IsPrepared returns true if stmt is a prepare statement.

func (*ExecStmt) IsReadOnly Uses

func (a *ExecStmt) IsReadOnly(vars *variable.SessionVars) bool

IsReadOnly returns true if a statement is read only. If current StmtNode is an ExecuteStmt, we can get its prepared stmt, then using ast.IsReadOnly function to determine a statement is read only or not.

func (*ExecStmt) LogSlowQuery Uses

func (a *ExecStmt) LogSlowQuery(txnTS uint64, succ bool)

LogSlowQuery is used to print the slow query in the log files.

func (*ExecStmt) OriginText Uses

func (a *ExecStmt) OriginText() string

OriginText returns original statement as a string.

func (*ExecStmt) RebuildPlan Uses

func (a *ExecStmt) RebuildPlan(ctx context.Context) (int64, error)

RebuildPlan rebuilds current execute statement plan. It returns the current information schema version that 'a' is using.

func (*ExecStmt) SummaryStmt Uses

func (a *ExecStmt) SummaryStmt()

SummaryStmt collects statements for performance_schema.events_statements_summary_by_digest

type ExecuteExec Uses

type ExecuteExec struct {
    // contains filtered or unexported fields
}

ExecuteExec represents an EXECUTE executor. It cannot be executed by itself, all it needs to do is to build another Executor from a prepared statement.

func (*ExecuteExec) Build Uses

func (e *ExecuteExec) Build(b *executorBuilder) error

Build builds a prepared statement into an executor. After Build, e.StmtExec will be used to do the real execution.

func (*ExecuteExec) Close Uses

func (e *ExecuteExec) Close() error

Close closes all executors and release all resources.

func (*ExecuteExec) Next Uses

func (e *ExecuteExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ExecuteExec) Open Uses

func (e *ExecuteExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ExecuteExec) Schema Uses

func (e *ExecuteExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type Executor Uses

type Executor interface {
    Open(context.Context) error
    Next(ctx context.Context, req *chunk.Chunk) error
    Close() error
    Schema() *expression.Schema
    // contains filtered or unexported methods
}

Executor is the physical implementation of a algebra operator.

In TiDB, all algebra operators are implemented as iterators, i.e., they support a simple Open-Next-Close protocol. See this paper for more details:

"Volcano-An Extensible and Parallel Query Evaluation System"

Different from Volcano's execution model, a "Next" function call in TiDB will return a batch of rows, other than a single row in Volcano. NOTE: Executors must call "chk.Reset()" before appending their results to it.

type ExplainExec Uses

type ExplainExec struct {
    // contains filtered or unexported fields
}

ExplainExec represents an explain executor.

func (*ExplainExec) Close Uses

func (e *ExplainExec) Close() error

Close implements the Executor Close interface.

func (*ExplainExec) Next Uses

func (e *ExplainExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ExplainExec) Open Uses

func (e *ExplainExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*ExplainExec) Schema Uses

func (e *ExplainExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type GrantExec Uses

type GrantExec struct {
    Privs      []*ast.PrivElem
    ObjectType ast.ObjectTypeType
    Level      *ast.GrantLevel
    Users      []*ast.UserSpec

    WithGrant bool
    // contains filtered or unexported fields
}

GrantExec executes GrantStmt.

func (*GrantExec) Close Uses

func (e *GrantExec) Close() error

Close closes all executors and release all resources.

func (*GrantExec) Next Uses

func (e *GrantExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*GrantExec) Open Uses

func (e *GrantExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*GrantExec) Schema Uses

func (e *GrantExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type HashAggExec Uses

type HashAggExec struct {
    PartialAggFuncs []aggfuncs.AggFunc
    FinalAggFuncs   []aggfuncs.AggFunc

    GroupByItems []expression.Expression
    // contains filtered or unexported fields
}

HashAggExec deals with all the aggregate functions. It is built from the Aggregate Plan. When Next() is called, it reads all the data from Src and updates all the items in PartialAggFuncs. The parallel execution flow is as the following graph shows:

                  +-------------+
                  | Main Thread |
                  +------+------+
                         ^
                         |
                         +
                    +-+-            +-+
                    | |    ......   | |  finalOutputCh
                    +++-            +-+
                     ^
                     |
                     +---------------+
                     |               |
       +--------------+             +--------------+
       | final worker |     ......  | final worker |
       +------------+-+             +-+------------+
                    ^                 ^
                    |                 |
                   +-+  +-+  ......  +-+
                   | |  | |          | |
                   ...  ...          ...    partialOutputChs
                   | |  | |          | |
                   +++  +++          +++
                    ^    ^            ^
+-+                 |    |            |
| |        +--------o----+            |

inputCh +-+ | +-----------------+---+

    | |        |                              |
    ...    +---+------------+            +----+-----------+
    | |    | partial worker |   ......   | partial worker |
    +++    +--------------+-+            +-+--------------+
     |                     ^                ^
     |                     |                |
+----v---------+          +++ +-+          +++
| data fetcher | +------> | | | |  ......  | |   partialInputChs
+--------------+          +-+ +-+          +-+

func (*HashAggExec) Close Uses

func (e *HashAggExec) Close() error

Close implements the Executor Close interface.

func (*HashAggExec) Next Uses

func (e *HashAggExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*HashAggExec) Open Uses

func (e *HashAggExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*HashAggExec) Schema Uses

func (e *HashAggExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type HashAggFinalWorker Uses

type HashAggFinalWorker struct {
    // contains filtered or unexported fields
}

HashAggFinalWorker indicates the final workers of parallel hash agg execution, the number of the worker can be set by `tidb_hashagg_final_concurrency`.

type HashAggInput Uses

type HashAggInput struct {
    // contains filtered or unexported fields
}

HashAggInput indicates the input of hash agg exec.

type HashAggIntermData Uses

type HashAggIntermData struct {
    // contains filtered or unexported fields
}

HashAggIntermData indicates the intermediate data of aggregation execution.

type HashAggPartialWorker Uses

type HashAggPartialWorker struct {
    // contains filtered or unexported fields
}

HashAggPartialWorker indicates the partial workers of parallel hash agg execution, the number of the worker can be set by `tidb_hashagg_partial_concurrency`.

type HashJoinExec Uses

type HashJoinExec struct {
    // contains filtered or unexported fields
}

HashJoinExec implements the hash join algorithm.

func (*HashJoinExec) Close Uses

func (e *HashJoinExec) Close() error

Close implements the Executor Close interface.

func (*HashJoinExec) Next Uses

func (e *HashJoinExec) Next(ctx context.Context, req *chunk.Chunk) (err error)

Next implements the Executor Next interface. hash join constructs the result following these steps: step 1. fetch data from inner child and build a hash table; step 2. fetch data from outer child in a background goroutine and probe the hash table in multiple join workers.

func (*HashJoinExec) Open Uses

func (e *HashJoinExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*HashJoinExec) Schema Uses

func (e *HashJoinExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type IndexLookUpExecutor Uses

type IndexLookUpExecutor struct {
    // contains filtered or unexported fields
}

IndexLookUpExecutor implements double read for index scan.

func (*IndexLookUpExecutor) Close Uses

func (e *IndexLookUpExecutor) Close() error

Close implements Exec Close interface.

func (*IndexLookUpExecutor) Next Uses

func (e *IndexLookUpExecutor) Next(ctx context.Context, req *chunk.Chunk) error

Next implements Exec Next interface.

func (*IndexLookUpExecutor) Open Uses

func (e *IndexLookUpExecutor) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*IndexLookUpExecutor) Schema Uses

func (e *IndexLookUpExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type IndexLookUpJoin Uses

type IndexLookUpJoin struct {
    // contains filtered or unexported fields
}

IndexLookUpJoin employs one outer worker and N innerWorkers to execute concurrently. It preserves the order of the outer table and support batch lookup.

The execution flow is very similar to IndexLookUpReader: 1. outerWorker read N outer rows, build a task and send it to result channel and inner worker channel. 2. The innerWorker receives the task, builds key ranges from outer rows and fetch inner rows, builds inner row hash map. 3. main thread receives the task, waits for inner worker finish handling the task. 4. main thread join each outer row by look up the inner rows hash map in the task.

func (*IndexLookUpJoin) Close Uses

func (e *IndexLookUpJoin) Close() error

Close implements the Executor interface.

func (*IndexLookUpJoin) Next Uses

func (e *IndexLookUpJoin) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor interface.

func (*IndexLookUpJoin) Open Uses

func (e *IndexLookUpJoin) Open(ctx context.Context) error

Open implements the Executor interface.

func (*IndexLookUpJoin) Schema Uses

func (e *IndexLookUpJoin) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type IndexNestedLoopHashJoin Uses

type IndexNestedLoopHashJoin struct {
    IndexLookUpJoin
    // contains filtered or unexported fields
}

IndexNestedLoopHashJoin employs one outer worker and N inner workers to execute concurrently. The output order is not promised.

The execution flow is very similar to IndexLookUpReader: 1. The outer worker reads N outer rows, builds a task and sends it to the inner worker channel. 2. The inner worker receives the tasks and does 3 things for every task:

1. builds hash table from the outer rows
2. builds key ranges from outer rows and fetches inner rows
3. probes the hash table and sends the join result to the main thread channel.
Note: step 1 and step 2 runs concurrently.

3. The main thread receives the join results.

func (*IndexNestedLoopHashJoin) Close Uses

func (e *IndexNestedLoopHashJoin) Close() error

Close implements the IndexNestedLoopHashJoin Executor interface.

func (*IndexNestedLoopHashJoin) Next Uses

func (e *IndexNestedLoopHashJoin) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the IndexNestedLoopHashJoin Executor interface.

func (*IndexNestedLoopHashJoin) Open Uses

func (e *IndexNestedLoopHashJoin) Open(ctx context.Context) error

Open implements the IndexNestedLoopHashJoin Executor interface.

func (*IndexNestedLoopHashJoin) Schema Uses

func (e *IndexNestedLoopHashJoin) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type IndexReaderExecutor Uses

type IndexReaderExecutor struct {
    // contains filtered or unexported fields
}

IndexReaderExecutor sends dag request and reads index data from kv layer.

func (*IndexReaderExecutor) Close Uses

func (e *IndexReaderExecutor) Close() error

Close clears all resources hold by current object.

func (*IndexReaderExecutor) Next Uses

func (e *IndexReaderExecutor) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*IndexReaderExecutor) Open Uses

func (e *IndexReaderExecutor) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*IndexReaderExecutor) Schema Uses

func (e *IndexReaderExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

func (IndexReaderExecutor) SelectResult Uses

func (sr IndexReaderExecutor) SelectResult(ctx context.Context, sctx sessionctx.Context, kvReq *kv.Request,
    fieldTypes []*types.FieldType, fb *statistics.QueryFeedback, copPlanIDs []fmt.Stringer, rootPlanID fmt.Stringer) (distsql.SelectResult, error)

type InsertExec Uses

type InsertExec struct {
    *InsertValues
    OnDuplicate []*expression.Assignment
    Priority    mysql.PriorityEnum
}

InsertExec represents an insert executor.

func (*InsertExec) Close Uses

func (e *InsertExec) Close() error

Close implements the Executor Close interface.

func (*InsertExec) Next Uses

func (e *InsertExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*InsertExec) Open Uses

func (e *InsertExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (InsertExec) Schema Uses

func (e InsertExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type InsertValues Uses

type InsertValues struct {
    SelectExec Executor

    Table   table.Table
    Columns []*ast.ColumnName
    Lists   [][]expression.Expression
    SetList []*expression.Assignment

    GenColumns []*ast.ColumnName
    GenExprs   []expression.Expression
    // contains filtered or unexported fields
}

InsertValues is the data to insert.

func (*InsertValues) Close Uses

func (e *InsertValues) Close() error

Close closes all executors and release all resources.

func (*InsertValues) Next Uses

func (e *InsertValues) Next(ctx context.Context, req *chunk.Chunk) error

Next fills multiple rows into a chunk.

func (*InsertValues) Open Uses

func (e *InsertValues) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*InsertValues) Schema Uses

func (e *InsertValues) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type LimitExec Uses

type LimitExec struct {
    // contains filtered or unexported fields
}

LimitExec represents limit executor It ignores 'Offset' rows from src, then returns 'Count' rows at maximum.

func (*LimitExec) Close Uses

func (e *LimitExec) Close() error

Close implements the Executor Close interface.

func (*LimitExec) Next Uses

func (e *LimitExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*LimitExec) Open Uses

func (e *LimitExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*LimitExec) Schema Uses

func (e *LimitExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type LoadDataExec Uses

type LoadDataExec struct {
    IsLocal     bool
    OnDuplicate ast.OnDuplicateKeyHandlingType
    // contains filtered or unexported fields
}

LoadDataExec represents a load data executor.

func (*LoadDataExec) Close Uses

func (e *LoadDataExec) Close() error

Close implements the Executor Close interface.

func (*LoadDataExec) Next Uses

func (e *LoadDataExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*LoadDataExec) Open Uses

func (e *LoadDataExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*LoadDataExec) Schema Uses

func (e *LoadDataExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type LoadDataInfo Uses

type LoadDataInfo struct {
    *InsertValues

    Path        string
    Table       table.Table
    FieldsInfo  *ast.FieldsClause
    LinesInfo   *ast.LinesClause
    IgnoreLines uint64
    Ctx         sessionctx.Context

    StopCh chan struct{}
    QuitCh chan struct{}
    // contains filtered or unexported fields
}

LoadDataInfo saves the information of loading data operation.

func NewLoadDataInfo Uses

func NewLoadDataInfo(ctx sessionctx.Context, row []types.Datum, tbl table.Table, cols []*table.Column) *LoadDataInfo

NewLoadDataInfo returns a LoadDataInfo structure, and it's only used for tests now.

func (*LoadDataInfo) CheckAndInsertOneBatch Uses

func (e *LoadDataInfo) CheckAndInsertOneBatch(ctx context.Context, rows [][]types.Datum, cnt uint64) error

CheckAndInsertOneBatch is used to commit one transaction batch full filled data

func (LoadDataInfo) Close Uses

func (e LoadDataInfo) Close() error

Close closes all executors and release all resources.

func (*LoadDataInfo) CloseTaskQueue Uses

func (e *LoadDataInfo) CloseTaskQueue()

CloseTaskQueue preparing routine to inform commit routine no more data

func (*LoadDataInfo) CommitOneTask Uses

func (e *LoadDataInfo) CommitOneTask(ctx context.Context, task CommitTask) error

CommitOneTask insert Data from LoadDataInfo.rows, then make commit and refresh txn

func (*LoadDataInfo) CommitWork Uses

func (e *LoadDataInfo) CommitWork(ctx context.Context) error

CommitWork commit batch sequentially

func (*LoadDataInfo) EnqOneTask Uses

func (e *LoadDataInfo) EnqOneTask(ctx context.Context) error

EnqOneTask feed one batch commit task to commit work

func (*LoadDataInfo) ForceQuit Uses

func (e *LoadDataInfo) ForceQuit()

ForceQuit let commit quit directly

func (*LoadDataInfo) GetCurBatchCnt Uses

func (e *LoadDataInfo) GetCurBatchCnt() uint64

GetCurBatchCnt getter for curBatchCnt

func (*LoadDataInfo) GetRows Uses

func (e *LoadDataInfo) GetRows() [][]types.Datum

GetRows getter for rows

func (*LoadDataInfo) InitQueues Uses

func (e *LoadDataInfo) InitQueues()

InitQueues initialize task queue and error report queue

func (*LoadDataInfo) InsertData Uses

func (e *LoadDataInfo) InsertData(ctx context.Context, prevData, curData []byte) ([]byte, bool, error)

InsertData inserts data into specified table according to the specified format. If it has the rest of data isn't completed the processing, then it returns without completed data. If the number of inserted rows reaches the batchRows, then the second return value is true. If prevData isn't nil and curData is nil, there are no other data to deal with and the isEOF is true.

func (*LoadDataInfo) MakeCommitTask Uses

func (e *LoadDataInfo) MakeCommitTask() CommitTask

MakeCommitTask produce commit task with data in LoadDataInfo.rows LoadDataInfo.curBatchCnt

func (LoadDataInfo) Next Uses

func (e LoadDataInfo) Next(ctx context.Context, req *chunk.Chunk) error

Next fills multiple rows into a chunk.

func (LoadDataInfo) Open Uses

func (e LoadDataInfo) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (LoadDataInfo) Schema Uses

func (e LoadDataInfo) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

func (*LoadDataInfo) SetMaxRowsInBatch Uses

func (e *LoadDataInfo) SetMaxRowsInBatch(limit uint64)

SetMaxRowsInBatch sets the max number of rows to insert in a batch.

func (*LoadDataInfo) SetMessage Uses

func (e *LoadDataInfo) SetMessage()

SetMessage sets info message(ERR_LOAD_INFO) generated by LOAD statement, it is public because of the special way that LOAD statement is handled.

func (*LoadDataInfo) StartStopWatcher Uses

func (e *LoadDataInfo) StartStopWatcher()

StartStopWatcher monitor StopCh to force quit

type LoadStatsExec Uses

type LoadStatsExec struct {
    // contains filtered or unexported fields
}

LoadStatsExec represents a load statistic executor.

func (*LoadStatsExec) Close Uses

func (e *LoadStatsExec) Close() error

Close implements the Executor Close interface.

func (*LoadStatsExec) Next Uses

func (e *LoadStatsExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*LoadStatsExec) Open Uses

func (e *LoadStatsExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*LoadStatsExec) Schema Uses

func (e *LoadStatsExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type LoadStatsInfo Uses

type LoadStatsInfo struct {
    Path string
    Ctx  sessionctx.Context
}

LoadStatsInfo saves the information of loading statistic operation.

func (*LoadStatsInfo) Update Uses

func (e *LoadStatsInfo) Update(data []byte) error

Update updates the stats of the corresponding table according to the data.

type MaxOneRowExec Uses

type MaxOneRowExec struct {
    // contains filtered or unexported fields
}

MaxOneRowExec checks if the number of rows that a query returns is at maximum one. It's built from subquery expression.

func (*MaxOneRowExec) Close Uses

func (e *MaxOneRowExec) Close() error

Close closes all executors and release all resources.

func (*MaxOneRowExec) Next Uses

func (e *MaxOneRowExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*MaxOneRowExec) Open Uses

func (e *MaxOneRowExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*MaxOneRowExec) Schema Uses

func (e *MaxOneRowExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type MergeJoinExec Uses

type MergeJoinExec struct {
    // contains filtered or unexported fields
}

MergeJoinExec implements the merge join algorithm. This operator assumes that two iterators of both sides will provide required order on join condition: 1. For equal-join, one of the join key from each side matches the order given. 2. For other cases its preferred not to use SMJ and operator will throw error.

func (*MergeJoinExec) Close Uses

func (e *MergeJoinExec) Close() error

Close implements the Executor Close interface.

func (*MergeJoinExec) Next Uses

func (e *MergeJoinExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*MergeJoinExec) Open Uses

func (e *MergeJoinExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*MergeJoinExec) Schema Uses

func (e *MergeJoinExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type MockPhysicalPlan Uses

type MockPhysicalPlan interface {
    plannercore.PhysicalPlan
    GetExecutor() Executor
}

MockPhysicalPlan is used to return a specified executor in when build. It is mainly used for testing.

type NestedLoopApplyExec Uses

type NestedLoopApplyExec struct {
    // contains filtered or unexported fields
}

NestedLoopApplyExec is the executor for apply.

func (*NestedLoopApplyExec) Close Uses

func (e *NestedLoopApplyExec) Close() error

Close implements the Executor interface.

func (*NestedLoopApplyExec) Next Uses

func (e *NestedLoopApplyExec) Next(ctx context.Context, req *chunk.Chunk) (err error)

Next implements the Executor interface.

func (*NestedLoopApplyExec) Open Uses

func (e *NestedLoopApplyExec) Open(ctx context.Context) error

Open implements the Executor interface.

func (*NestedLoopApplyExec) Schema Uses

func (e *NestedLoopApplyExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type PointGetExecutor Uses

type PointGetExecutor struct {
    // contains filtered or unexported fields
}

PointGetExecutor executes point select query.

func (*PointGetExecutor) Close Uses

func (e *PointGetExecutor) Close() error

Close implements the Executor interface.

func (*PointGetExecutor) Next Uses

func (e *PointGetExecutor) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor interface.

func (*PointGetExecutor) Open Uses

func (e *PointGetExecutor) Open(context.Context) error

Open implements the Executor interface.

func (*PointGetExecutor) Schema Uses

func (e *PointGetExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type PrepareExec Uses

type PrepareExec struct {
    ID         uint32
    ParamCount int
    Fields     []*ast.ResultField
    // contains filtered or unexported fields
}

PrepareExec represents a PREPARE executor.

func NewPrepareExec Uses

func NewPrepareExec(ctx sessionctx.Context, is infoschema.InfoSchema, sqlTxt string) *PrepareExec

NewPrepareExec creates a new PrepareExec.

func (*PrepareExec) Close Uses

func (e *PrepareExec) Close() error

Close closes all executors and release all resources.

func (*PrepareExec) Next Uses

func (e *PrepareExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*PrepareExec) Open Uses

func (e *PrepareExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*PrepareExec) Schema Uses

func (e *PrepareExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ProjectionExec Uses

type ProjectionExec struct {
    // contains filtered or unexported fields
}

ProjectionExec implements the physical Projection Operator: https://en.wikipedia.org/wiki/Projection_(relational_algebra)

func (*ProjectionExec) Close Uses

func (e *ProjectionExec) Close() error

Close implements the Executor Close interface.

func (*ProjectionExec) Next Uses

func (e *ProjectionExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

Here we explain the execution flow of the parallel projection implementation. There are 3 main components:

1. "projectionInputFetcher": Fetch input "Chunk" from child.
2. "projectionWorker":       Do the projection work.
3. "ProjectionExec.Next":    Return result to parent.

1. "projectionInputFetcher" gets its input and output resources from its "inputCh" and "outputCh" channel, once the input and output resources are abtained, it fetches child's result into "input.chk" and:

a. Dispatches this input to the worker specified in "input.targetWorker"
b. Dispatches this output to the main thread: "ProjectionExec.Next"
c. Dispatches this output to the worker specified in "input.targetWorker"

It is finished and exited once:

a. There is no more input from child.
b. "ProjectionExec" close the "globalFinishCh"

2. "projectionWorker" gets its input and output resources from its "inputCh" and "outputCh" channel, once the input and output resources are abtained, it calculates the projection result use "input.chk" as the input and "output.chk" as the output, once the calculation is done, it:

a. Sends "nil" or error to "output.done" to mark this input is finished.
b. Returns the "input" resource to "projectionInputFetcher.inputCh"

They are finished and exited once:

a. "ProjectionExec" closes the "globalFinishCh"

3. "ProjectionExec.Next" gets its output resources from its "outputCh" channel. After receiving an output from "outputCh", it should wait to receive a "nil" or error from "output.done" channel. Once a "nil" or error is received:

 a. Returns this output to its parent
 b. Returns the "output" resource to "projectionInputFetcher.outputCh"

+-----------+----------------------+--------------------------+
|           |                      |                          |
|  +--------+---------+   +--------+---------+       +--------+---------+
|  | projectionWorker |   + projectionWorker |  ...  + projectionWorker |
|  +------------------+   +------------------+       +------------------+
|       ^       ^              ^       ^                  ^       ^
|       |       |              |       |                  |       |
|    inputCh outputCh       inputCh outputCh           inputCh outputCh
|       ^       ^              ^       ^                  ^       ^
|       |       |              |       |                  |       |
|                              |       |
|                              |       +----------------->outputCh
|                              |       |                      |
|                              |       |                      v
|                      +-------+-------+--------+   +---------------------+
|                      | projectionInputFetcher |   | ProjectionExec.Next |
|                      +------------------------+   +---------+-----------+
|                              ^       ^                      |
|                              |       |                      |
|                           inputCh outputCh                  |
|                              ^       ^                      |
|                              |       |                      |
+------------------------------+       +----------------------+

func (*ProjectionExec) Open Uses

func (e *ProjectionExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*ProjectionExec) Schema Uses

func (e *ProjectionExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type RecoverIndexExec Uses

type RecoverIndexExec struct {
    // contains filtered or unexported fields
}

RecoverIndexExec represents a recover index executor. It is built from "admin recover index" statement, is used to backfill corrupted index.

func (*RecoverIndexExec) Close Uses

func (e *RecoverIndexExec) Close() error

Close closes all executors and release all resources.

func (*RecoverIndexExec) Next Uses

func (e *RecoverIndexExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*RecoverIndexExec) Open Uses

func (e *RecoverIndexExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*RecoverIndexExec) Schema Uses

func (e *RecoverIndexExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ReloadExprPushdownBlacklistExec Uses

type ReloadExprPushdownBlacklistExec struct {
    // contains filtered or unexported fields
}

ReloadExprPushdownBlacklistExec indicates ReloadExprPushdownBlacklist executor.

func (*ReloadExprPushdownBlacklistExec) Close Uses

func (e *ReloadExprPushdownBlacklistExec) Close() error

Close closes all executors and release all resources.

func (*ReloadExprPushdownBlacklistExec) Next Uses

func (e *ReloadExprPushdownBlacklistExec) Next(ctx context.Context, _ *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ReloadExprPushdownBlacklistExec) Open Uses

func (e *ReloadExprPushdownBlacklistExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ReloadExprPushdownBlacklistExec) Schema Uses

func (e *ReloadExprPushdownBlacklistExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ReloadOptRuleBlacklistExec Uses

type ReloadOptRuleBlacklistExec struct {
    // contains filtered or unexported fields
}

ReloadOptRuleBlacklistExec indicates ReloadOptRuleBlacklist executor.

func (*ReloadOptRuleBlacklistExec) Close Uses

func (e *ReloadOptRuleBlacklistExec) Close() error

Close closes all executors and release all resources.

func (*ReloadOptRuleBlacklistExec) Next Uses

func (e *ReloadOptRuleBlacklistExec) Next(ctx context.Context, _ *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ReloadOptRuleBlacklistExec) Open Uses

func (e *ReloadOptRuleBlacklistExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ReloadOptRuleBlacklistExec) Schema Uses

func (e *ReloadOptRuleBlacklistExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ReplaceExec Uses

type ReplaceExec struct {
    *InsertValues
    Priority int
}

ReplaceExec represents a replace executor.

func (*ReplaceExec) Close Uses

func (e *ReplaceExec) Close() error

Close implements the Executor Close interface.

func (*ReplaceExec) Next Uses

func (e *ReplaceExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ReplaceExec) Open Uses

func (e *ReplaceExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (ReplaceExec) Schema Uses

func (e ReplaceExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type RevokeExec Uses

type RevokeExec struct {
    Privs      []*ast.PrivElem
    ObjectType ast.ObjectTypeType
    Level      *ast.GrantLevel
    Users      []*ast.UserSpec
    // contains filtered or unexported fields
}

RevokeExec executes RevokeStmt.

func (*RevokeExec) Close Uses

func (e *RevokeExec) Close() error

Close closes all executors and release all resources.

func (*RevokeExec) Next Uses

func (e *RevokeExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*RevokeExec) Open Uses

func (e *RevokeExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*RevokeExec) Schema Uses

func (e *RevokeExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SQLBindExec Uses

type SQLBindExec struct {
    // contains filtered or unexported fields
}

SQLBindExec represents a bind executor.

func (*SQLBindExec) Close Uses

func (e *SQLBindExec) Close() error

Close closes all executors and release all resources.

func (*SQLBindExec) Next Uses

func (e *SQLBindExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*SQLBindExec) Open Uses

func (e *SQLBindExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*SQLBindExec) Schema Uses

func (e *SQLBindExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SelectLockExec Uses

type SelectLockExec struct {
    Lock ast.SelectLockType
    // contains filtered or unexported fields
}

SelectLockExec represents a select lock executor. It is built from the "SELECT .. FOR UPDATE" or the "SELECT .. LOCK IN SHARE MODE" statement. For "SELECT .. FOR UPDATE" statement, it locks every row key from source Executor. After the execution, the keys are buffered in transaction, and will be sent to KV when doing commit. If there is any key already locked by another transaction, the transaction will rollback and retry.

func (*SelectLockExec) Close Uses

func (e *SelectLockExec) Close() error

Close closes all executors and release all resources.

func (*SelectLockExec) Next Uses

func (e *SelectLockExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*SelectLockExec) Open Uses

func (e *SelectLockExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*SelectLockExec) Schema Uses

func (e *SelectLockExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SelectionExec Uses

type SelectionExec struct {
    // contains filtered or unexported fields
}

SelectionExec represents a filter executor.

func (*SelectionExec) Close Uses

func (e *SelectionExec) Close() error

Close implements plannercore.Plan Close interface.

func (*SelectionExec) Next Uses

func (e *SelectionExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*SelectionExec) Open Uses

func (e *SelectionExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*SelectionExec) Schema Uses

func (e *SelectionExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SetExecutor Uses

type SetExecutor struct {
    // contains filtered or unexported fields
}

SetExecutor executes set statement.

func (*SetExecutor) Close Uses

func (e *SetExecutor) Close() error

Close closes all executors and release all resources.

func (*SetExecutor) Next Uses

func (e *SetExecutor) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*SetExecutor) Open Uses

func (e *SetExecutor) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*SetExecutor) Schema Uses

func (e *SetExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ShowDDLExec Uses

type ShowDDLExec struct {
    // contains filtered or unexported fields
}

ShowDDLExec represents a show DDL executor.

func (*ShowDDLExec) Close Uses

func (e *ShowDDLExec) Close() error

Close closes all executors and release all resources.

func (*ShowDDLExec) Next Uses

func (e *ShowDDLExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ShowDDLExec) Open Uses

func (e *ShowDDLExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ShowDDLExec) Schema Uses

func (e *ShowDDLExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ShowDDLJobQueriesExec Uses

type ShowDDLJobQueriesExec struct {
    // contains filtered or unexported fields
}

ShowDDLJobQueriesExec represents a show DDL job queries executor. The jobs id that is given by 'admin show ddl job queries' statement, only be searched in the latest 10 history jobs

func (*ShowDDLJobQueriesExec) Close Uses

func (e *ShowDDLJobQueriesExec) Close() error

Close closes all executors and release all resources.

func (*ShowDDLJobQueriesExec) Next Uses

func (e *ShowDDLJobQueriesExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ShowDDLJobQueriesExec) Open Uses

func (e *ShowDDLJobQueriesExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*ShowDDLJobQueriesExec) Schema Uses

func (e *ShowDDLJobQueriesExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ShowDDLJobsExec Uses

type ShowDDLJobsExec struct {
    // contains filtered or unexported fields
}

ShowDDLJobsExec represent a show DDL jobs executor.

func (*ShowDDLJobsExec) Close Uses

func (e *ShowDDLJobsExec) Close() error

Close closes all executors and release all resources.

func (*ShowDDLJobsExec) Next Uses

func (e *ShowDDLJobsExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ShowDDLJobsExec) Open Uses

func (e *ShowDDLJobsExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*ShowDDLJobsExec) Schema Uses

func (e *ShowDDLJobsExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ShowExec Uses

type ShowExec struct {
    Tp        ast.ShowStmtType // Databases/Tables/Columns/....
    DBName    model.CIStr
    Table     *ast.TableName       // Used for showing columns.
    Column    *ast.ColumnName      // Used for `desc table column`.
    IndexName model.CIStr          // Used for show table regions.
    Flag      int                  // Some flag parsed from sql, such as FULL.
    Roles     []*auth.RoleIdentity // Used for show grants.
    User      *auth.UserIdentity   // Used by show grants, show create user.

    Full        bool
    IfNotExists bool // Used for `show create database if not exists`
    GlobalScope bool // GlobalScope is used by show variables
    // contains filtered or unexported fields
}

ShowExec represents a show executor.

func (*ShowExec) Close Uses

func (e *ShowExec) Close() error

Close closes all executors and release all resources.

func (*ShowExec) Next Uses

func (e *ShowExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ShowExec) Open Uses

func (e *ShowExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ShowExec) Schema Uses

func (e *ShowExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ShowNextRowIDExec Uses

type ShowNextRowIDExec struct {
    // contains filtered or unexported fields
}

ShowNextRowIDExec represents a show the next row ID executor.

func (*ShowNextRowIDExec) Close Uses

func (e *ShowNextRowIDExec) Close() error

Close closes all executors and release all resources.

func (*ShowNextRowIDExec) Next Uses

func (e *ShowNextRowIDExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ShowNextRowIDExec) Open Uses

func (e *ShowNextRowIDExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*ShowNextRowIDExec) Schema Uses

func (e *ShowNextRowIDExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type ShowSlowExec Uses

type ShowSlowExec struct {
    ShowSlow *ast.ShowSlow
    // contains filtered or unexported fields
}

ShowSlowExec represents the executor of showing the slow queries. It is build from the "admin show slow" statement:

admin show slow top [internal | all] N
admin show slow recent N

func (*ShowSlowExec) Close Uses

func (e *ShowSlowExec) Close() error

Close closes all executors and release all resources.

func (*ShowSlowExec) Next Uses

func (e *ShowSlowExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*ShowSlowExec) Open Uses

func (e *ShowSlowExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*ShowSlowExec) Schema Uses

func (e *ShowSlowExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SimpleExec Uses

type SimpleExec struct {
    Statement ast.StmtNode
    // contains filtered or unexported fields
}

SimpleExec represents simple statement executor. For statements do simple execution. includes `UseStmt`, 'SetStmt`, `DoStmt`, `BeginStmt`, `CommitStmt`, `RollbackStmt`. TODO: list all simple statements.

func (*SimpleExec) Close Uses

func (e *SimpleExec) Close() error

Close closes all executors and release all resources.

func (*SimpleExec) Next Uses

func (e *SimpleExec) Next(ctx context.Context, req *chunk.Chunk) (err error)

Next implements the Executor Next interface.

func (*SimpleExec) Open Uses

func (e *SimpleExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*SimpleExec) Schema Uses

func (e *SimpleExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SortExec Uses

type SortExec struct {
    ByItems []*plannercore.ByItems
    Idx     int
    // contains filtered or unexported fields
}

SortExec represents sorting executor.

func (*SortExec) Close Uses

func (e *SortExec) Close() error

Close implements the Executor Close interface.

func (*SortExec) Next Uses

func (e *SortExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*SortExec) Open Uses

func (e *SortExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*SortExec) Schema Uses

func (e *SortExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SplitIndexRegionExec Uses

type SplitIndexRegionExec struct {
    // contains filtered or unexported fields
}

SplitIndexRegionExec represents a split index regions executor.

func (*SplitIndexRegionExec) Close Uses

func (e *SplitIndexRegionExec) Close() error

Close closes all executors and release all resources.

func (*SplitIndexRegionExec) Next Uses

func (e *SplitIndexRegionExec) Next(ctx context.Context, chk *chunk.Chunk) error

Next implements the Executor Next interface.

func (*SplitIndexRegionExec) Open Uses

func (e *SplitIndexRegionExec) Open(ctx context.Context) (err error)

Open implements the Executor Open interface.

func (*SplitIndexRegionExec) Schema Uses

func (e *SplitIndexRegionExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type SplitTableRegionExec Uses

type SplitTableRegionExec struct {
    // contains filtered or unexported fields
}

SplitTableRegionExec represents a split table regions executor.

func (*SplitTableRegionExec) Close Uses

func (e *SplitTableRegionExec) Close() error

Close closes all executors and release all resources.

func (*SplitTableRegionExec) Next Uses

func (e *SplitTableRegionExec) Next(ctx context.Context, chk *chunk.Chunk) error

Next implements the Executor Next interface.

func (*SplitTableRegionExec) Open Uses

func (e *SplitTableRegionExec) Open(ctx context.Context) (err error)

Open implements the Executor Open interface.

func (*SplitTableRegionExec) Schema Uses

func (e *SplitTableRegionExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type StreamAggExec Uses

type StreamAggExec struct {
    // contains filtered or unexported fields
}

StreamAggExec deals with all the aggregate functions. It assumes all the input data is sorted by group by key. When Next() is called, it will return a result for the same group.

func (*StreamAggExec) Close Uses

func (e *StreamAggExec) Close() error

Close implements the Executor Close interface.

func (*StreamAggExec) Next Uses

func (e *StreamAggExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*StreamAggExec) Open Uses

func (e *StreamAggExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*StreamAggExec) Schema Uses

func (e *StreamAggExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type TableDualExec Uses

type TableDualExec struct {
    // contains filtered or unexported fields
}

TableDualExec represents a dual table executor.

func (*TableDualExec) Close Uses

func (e *TableDualExec) Close() error

Close closes all executors and release all resources.

func (*TableDualExec) Next Uses

func (e *TableDualExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*TableDualExec) Open Uses

func (e *TableDualExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*TableDualExec) Schema Uses

func (e *TableDualExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type TableReaderExecutor Uses

type TableReaderExecutor struct {
    // contains filtered or unexported fields
}

TableReaderExecutor sends DAG request and reads table data from kv layer.

func (*TableReaderExecutor) Close Uses

func (e *TableReaderExecutor) Close() error

Close implements the Executor Close interface.

func (*TableReaderExecutor) Next Uses

func (e *TableReaderExecutor) Next(ctx context.Context, req *chunk.Chunk) error

Next fills data into the chunk passed by its caller. The task was actually done by tableReaderHandler.

func (*TableReaderExecutor) Open Uses

func (e *TableReaderExecutor) Open(ctx context.Context) error

Open initialzes necessary variables for using this executor.

func (*TableReaderExecutor) Schema Uses

func (e *TableReaderExecutor) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

func (TableReaderExecutor) SelectResult Uses

func (sr TableReaderExecutor) SelectResult(ctx context.Context, sctx sessionctx.Context, kvReq *kv.Request,
    fieldTypes []*types.FieldType, fb *statistics.QueryFeedback, copPlanIDs []fmt.Stringer, rootPlanID fmt.Stringer) (distsql.SelectResult, error)

type TableScanExec Uses

type TableScanExec struct {
    // contains filtered or unexported fields
}

TableScanExec is a table scan executor without result fields.

func (*TableScanExec) Close Uses

func (e *TableScanExec) Close() error

Close closes all executors and release all resources.

func (*TableScanExec) Next Uses

func (e *TableScanExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*TableScanExec) Open Uses

func (e *TableScanExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*TableScanExec) Schema Uses

func (e *TableScanExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type TopNExec Uses

type TopNExec struct {
    SortExec
    // contains filtered or unexported fields
}

TopNExec implements a Top-N algorithm and it is built from a SELECT statement with ORDER BY and LIMIT. Instead of sorting all the rows fetched from the table, it keeps the Top-N elements only in a heap to reduce memory usage.

func (*TopNExec) Next Uses

func (e *TopNExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*TopNExec) Open Uses

func (e *TopNExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*TopNExec) Schema Uses

func (e *TopNExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type TraceExec Uses

type TraceExec struct {

    // CollectedSpans collects all span during execution. Span is appended via
    // callback method which passes into tracer implementation.
    CollectedSpans []basictracer.RawSpan
    // contains filtered or unexported fields
}

TraceExec represents a root executor of trace query.

func (*TraceExec) Close Uses

func (e *TraceExec) Close() error

Close closes all executors and release all resources.

func (*TraceExec) Next Uses

func (e *TraceExec) Next(ctx context.Context, req *chunk.Chunk) error

Next executes real query and collects span later.

func (*TraceExec) Open Uses

func (e *TraceExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*TraceExec) Schema Uses

func (e *TraceExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type UnionExec Uses

type UnionExec struct {
    // contains filtered or unexported fields
}

UnionExec pulls all it's children's result and returns to its parent directly. A "resultPuller" is started for every child to pull result from that child and push it to the "resultPool", the used "Chunk" is obtained from the corresponding "resourcePool". All resultPullers are running concurrently.

                          +----------------+
+---> resourcePool 1 ---> | resultPuller 1 |-----+
|                         +----------------+     |
|                                                |
|                         +----------------+     v
+---> resourcePool 2 ---> | resultPuller 2 |-----> resultPool ---+
|                         +----------------+     ^               |
|                               ......           |               |
|                         +----------------+     |               |
+---> resourcePool n ---> | resultPuller n |-----+               |
|                         +----------------+                     |
|                                                                |
|                          +-------------+                       |
|--------------------------| main thread | <---------------------+
                           +-------------+

func (*UnionExec) Close Uses

func (e *UnionExec) Close() error

Close implements the Executor Close interface.

func (*UnionExec) Next Uses

func (e *UnionExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*UnionExec) Open Uses

func (e *UnionExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*UnionExec) Schema Uses

func (e *UnionExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type UnionScanExec Uses

type UnionScanExec struct {
    // contains filtered or unexported fields
}

UnionScanExec merges the rows from dirty table and the rows from distsql request.

func (*UnionScanExec) Close Uses

func (e *UnionScanExec) Close() error

Close closes all executors and release all resources.

func (*UnionScanExec) Len Uses

func (us *UnionScanExec) Len() int

Len implements sort.Interface interface.

func (*UnionScanExec) Less Uses

func (us *UnionScanExec) Less(i, j int) bool

Less implements sort.Interface interface.

func (*UnionScanExec) Next Uses

func (us *UnionScanExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*UnionScanExec) Open Uses

func (us *UnionScanExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*UnionScanExec) Schema Uses

func (e *UnionScanExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

func (*UnionScanExec) Swap Uses

func (us *UnionScanExec) Swap(i, j int)

Swap implements sort.Interface interface.

type UpdateExec Uses

type UpdateExec struct {
    OrderedList []*expression.Assignment
    // contains filtered or unexported fields
}

UpdateExec represents a new update executor.

func (*UpdateExec) Close Uses

func (e *UpdateExec) Close() error

Close implements the Executor Close interface.

func (*UpdateExec) Next Uses

func (e *UpdateExec) Next(ctx context.Context, req *chunk.Chunk) error

Next implements the Executor Next interface.

func (*UpdateExec) Open Uses

func (e *UpdateExec) Open(ctx context.Context) error

Open implements the Executor Open interface.

func (*UpdateExec) Schema Uses

func (e *UpdateExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

type WindowExec Uses

type WindowExec struct {
    // contains filtered or unexported fields
}

WindowExec is the executor for window functions.

func (*WindowExec) Close Uses

func (e *WindowExec) Close() error

Close implements the Executor Close interface.

func (*WindowExec) Next Uses

func (e *WindowExec) Next(ctx context.Context, chk *chunk.Chunk) error

Next implements the Executor Next interface.

func (*WindowExec) Open Uses

func (e *WindowExec) Open(ctx context.Context) error

Open initializes children recursively and "childrenResults" according to children's schemas.

func (*WindowExec) Schema Uses

func (e *WindowExec) Schema() *expression.Schema

Schema returns the current baseExecutor's schema. If it is nil, then create and return a new one.

Directories

PathSynopsis
aggfuncs

Package executor imports 92 packages (graph) and is imported by 41 packages. Updated 2019-09-18. Refresh now. Tools for package owners.