Documentation
¶
Index ¶
- Constants
- Variables
- func AddAccumulatorIter(ctx *sql.Context, iter sql.RowIter) (sql.RowIter, sql.Schema)
- func AddExpressionCloser(node sql.Node, iter sql.RowIter) sql.RowIter
- func AddTransactionCommittingIter(ctx *sql.Context, qFlags *sql.QueryFlags, iter sql.RowIter) (sql.RowIter, error)
- func AddTriggerRollbackIter(ctx *sql.Context, qFlags *sql.QueryFlags, iter sql.RowIter) sql.RowIter
- func FinalizeIters(ctx *sql.Context, analyzed sql.Node, qFlags *sql.QueryFlags, iter sql.RowIter) (sql.RowIter, sql.Schema, error)
- func GetColumnsAndPrepareExpressions(exprs []sql.Expression) ([]string, []sql.Expression, error)
- func NewLeftMergeJoin(left, right sql.Node, cond sql.Expression) *plan.JoinNode
- func NewMergeJoin(left, right sql.Node, cond sql.Expression) *plan.JoinNode
- func NewOverrideBuilder(override sql.NodeExecBuilder) sql.NodeExecBuilder
- func ProjectRow(ctx *sql.Context, projections []sql.Expression, row sql.Row) (sql.Row, error)
- type BaseBuilder
- type EvalPartitionKeyValueIter
- type ExecBuilderFunc
- type ExprCloserIter
- type FulltextFilterTable
- func (f *FulltextFilterTable) Collation() sql.CollationID
- func (f *FulltextFilterTable) LookupPartitions(ctx *sql.Context, lookup sql.IndexLookup) (sql.PartitionIter, error)
- func (f *FulltextFilterTable) Name() string
- func (f *FulltextFilterTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)
- func (f *FulltextFilterTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
- func (f *FulltextFilterTable) Schema() sql.Schema
- func (f *FulltextFilterTable) String() string
- type NameAndSchema
- type ProjectIter
- type TransactionCommittingIter
Constants ¶
const TriggerSavePointPrefix = "__go_mysql_server_trigger_savepoint__"
Variables ¶
var DefaultBuilder = &BaseBuilder{}
var ErrTableNotLockable = errors.NewKind("table %s is not lockable")
ErrTableNotLockable is returned whenever a lockable table can't be found.
Functions ¶
func AddAccumulatorIter ¶ added in v0.19.0
func AddExpressionCloser ¶ added in v0.16.0
AddExpressionCloser returns a new iterator that ensures that any expressions that implement sql.Closer are closed. If there are no expressions that implement sql.Closer in the tree, then the original iterator is returned.
func AddTransactionCommittingIter ¶ added in v0.19.0
func AddTriggerRollbackIter ¶ added in v0.19.0
func FinalizeIters ¶ added in v0.19.0
func FinalizeIters(ctx *sql.Context, analyzed sql.Node, qFlags *sql.QueryFlags, iter sql.RowIter) (sql.RowIter, sql.Schema, error)
FinalizeIters applies the final transformations on sql.RowIter before execution.
func GetColumnsAndPrepareExpressions ¶
func GetColumnsAndPrepareExpressions( exprs []sql.Expression, ) ([]string, []sql.Expression, error)
GetColumnsAndPrepareExpressions extracts the unique columns required by all those expressions and fixes the indexes of the GetFields in the expressions to match a row with only the returned columns in that same order.
func NewLeftMergeJoin ¶
func NewMergeJoin ¶
NewMergeJoin returns a node that performs a presorted merge join on two relations. We require 1) the join filter is an equality with disjoint join attributes, 2) the free attributes for a relation are a prefix for an index that will be used to return sorted rows.
func NewOverrideBuilder ¶ added in v0.19.0
func NewOverrideBuilder(override sql.NodeExecBuilder) sql.NodeExecBuilder
Types ¶
type BaseBuilder ¶
type BaseBuilder struct {
// contains filtered or unexported fields
}
BaseBuilder converts a plan tree into a RowIter tree. All relational nodes have a build statement. Custom source nodes that provide rows that implement sql.ExecSourceRel are also built into the tree.
type EvalPartitionKeyValueIter ¶
type EvalPartitionKeyValueIter struct {
// contains filtered or unexported fields
}
func NewEvalPartitionKeyValueIter ¶
func NewEvalPartitionKeyValueIter(iter sql.PartitionIndexKeyValueIter, columns []string, exprs []sql.Expression) *EvalPartitionKeyValueIter
func (*EvalPartitionKeyValueIter) Close ¶
func (i *EvalPartitionKeyValueIter) Close(ctx *sql.Context) error
func (*EvalPartitionKeyValueIter) Next ¶
func (i *EvalPartitionKeyValueIter) Next(ctx *sql.Context) (sql.Partition, sql.IndexKeyValueIter, error)
type ExecBuilderFunc ¶
type ExprCloserIter ¶ added in v0.19.0
type ExprCloserIter struct {
// contains filtered or unexported fields
}
ExprCloserIter ensures that all expressions that implement sql.Closer are closed. This is implemented as a capturing iterator, as our workflow only supports closing nodes, not expressions.
func (*ExprCloserIter) Close ¶ added in v0.19.0
func (eci *ExprCloserIter) Close(ctx *sql.Context) error
Close implements the interface sql.RowIter.
func (*ExprCloserIter) GetIter ¶ added in v0.19.0
func (eci *ExprCloserIter) GetIter() sql.RowIter
func (*ExprCloserIter) WithChildIter ¶ added in v0.19.0
func (eci *ExprCloserIter) WithChildIter(childIter sql.RowIter) sql.RowIter
type FulltextFilterTable ¶ added in v0.17.0
type FulltextFilterTable struct { MatchAgainst *expression.MatchAgainst Table sql.TableNode }
FulltextFilterTable handles row iteration for filters involving Full-Text indexes, as they behave differently than other indexes. This acts as a sort of wrapper, so that integrators do not need to implement special logic on their side.
This takes a MatchAgainst expression, as it will have already resolved the index and necessary tables, therefore we do not need to replicate the work here. Although they may seem similar in functionality, they are performing two different functions. This filter table determines if we need to calculate the relevancy of a word, by only returning rows that exist within our index tables. If a word does not exist within the tables, then we can assume that it has a relevancy of zero (for the default search mode). Therefore, we can skip processing that row altogether. The existence of a row does not imply that the relevancy value will be non-zero though, as the relevancy calculation can return a zero due to rounding (as is the case with the MyISAM backend, which we currently do not support).
func (*FulltextFilterTable) Collation ¶ added in v0.17.0
func (f *FulltextFilterTable) Collation() sql.CollationID
Collation implements the interface sql.IndexedTable.
func (*FulltextFilterTable) LookupPartitions ¶ added in v0.17.0
func (f *FulltextFilterTable) LookupPartitions(ctx *sql.Context, lookup sql.IndexLookup) (sql.PartitionIter, error)
LookupPartitions implements the interface sql.IndexedTable.
func (*FulltextFilterTable) Name ¶ added in v0.17.0
func (f *FulltextFilterTable) Name() string
Name implements the interface sql.IndexedTable.
func (*FulltextFilterTable) PartitionRows ¶ added in v0.17.0
func (f *FulltextFilterTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)
PartitionRows implements the interface sql.IndexedTable.
func (*FulltextFilterTable) Partitions ¶ added in v0.17.0
func (f *FulltextFilterTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)
Partitions implements the interface sql.IndexedTable.
func (*FulltextFilterTable) Schema ¶ added in v0.17.0
func (f *FulltextFilterTable) Schema() sql.Schema
Schema implements the interface sql.IndexedTable.
func (*FulltextFilterTable) String ¶ added in v0.17.0
func (f *FulltextFilterTable) String() string
String implements the interface sql.IndexedTable.
type ProjectIter ¶ added in v0.19.0
type ProjectIter struct {
// contains filtered or unexported fields
}
func (*ProjectIter) CanDefer ¶ added in v0.19.0
func (i *ProjectIter) CanDefer() bool
func (*ProjectIter) GetChildIter ¶ added in v0.19.0
func (i *ProjectIter) GetChildIter() sql.RowIter
func (*ProjectIter) GetProjections ¶ added in v0.19.0
func (i *ProjectIter) GetProjections() []sql.Expression
type TransactionCommittingIter ¶ added in v0.19.0
type TransactionCommittingIter struct {
// contains filtered or unexported fields
}
TransactionCommittingIter is a simple RowIter wrapper to allow the engine to conditionally commit a transaction during the Close() operation
func (*TransactionCommittingIter) Close ¶ added in v0.19.0
func (t *TransactionCommittingIter) Close(ctx *sql.Context) error
func (*TransactionCommittingIter) GetIter ¶ added in v0.19.0
func (t *TransactionCommittingIter) GetIter() sql.RowIter
func (*TransactionCommittingIter) WithChildIter ¶ added in v0.19.0
func (t *TransactionCommittingIter) WithChildIter(childIter sql.RowIter) sql.RowIter