Documentation ¶
Index ¶
- Constants
- Variables
- func AddExpressionCloser(node sql.Node, iter sql.RowIter) sql.RowIter
- 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 ProjectRow(ctx *sql.Context, projections []sql.Expression, row sql.Row) (sql.Row, error)
- type BaseBuilder
- type EvalPartitionKeyValueIter
- type ExecBuilderFunc
- 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
Constants ¶
const SavePointName = "__go_mysql_server_starting_savepoint__"
Variables ¶
var DefaultBuilder = &BaseBuilder{}
var ErrMergeJoinExpectsComparerFilters = errors.New("merge join expects expression.Comparer filters, found: %T")
var ErrTableNotLockable = errors.NewKind("table %s is not lockable")
ErrTableNotLockable is returned whenever a lockable table can't be found.
Functions ¶
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 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.
Types ¶
type BaseBuilder ¶
type BaseBuilder struct{}
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 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.
Source Files ¶
- agg.go
- builder.go
- ddl.go
- ddl_iters.go
- delete.go
- dml.go
- dml_iters.go
- expr_closer.go
- fulltext_filter.go
- insert.go
- join_iters.go
- merge_join.go
- node_builder.gen.go
- other.go
- other_iters.go
- priv.go
- proc.go
- proc_iters.go
- range_heap_iter.go
- rel.go
- rel_iters.go
- show.go
- show_iters.go
- transaction.go
- transaction_iters.go
- update.go