visitor

package
v0.0.0-...-66c7839 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IN_KEY_TYPE_NONE = iota
	IN_KEY_TYPE_INT64
	IN_KEY_TYPE_UINT64
	IN_KEY_TYPE_FLOAT64
	IN_KEY_TYPE_STR
)

Variables

This section is empty.

Functions

func GetKeyType

func GetKeyType(data interface{}) int

func GetKeyTypeString

func GetKeyTypeString(key int) string

func GetValueExprValue

func GetValueExprValue(node *driver.ValueExpr) (interface{}, error)

Types

type BetweenAndElement

type BetweenAndElement struct {
	Not   bool
	Left  interface{}
	Right interface{}
}

func NewBetweenAndElement

func NewBetweenAndElement(not bool, left interface{}, right interface{}) *BetweenAndElement

func (*BetweenAndElement) Matched

func (this *BetweenAndElement) Matched(other interface{}) bool

type Filter

type Filter struct {
	Left   string
	Op     opcode.Op
	Right  interface{}
	ColPos int // 字段所在的位置
}

func NewFilter

func NewFilter(col string, op opcode.Op, val interface{}) *Filter

func (*Filter) Compare

func (this *Filter) Compare(other interface{}) bool

func (*Filter) String

func (this *Filter) String() string

type InElement

type InElement struct {
	KeyType int
	Not     bool
	Data    map[interface{}]struct{}
}

func NewInElement

func NewInElement(keyType int, not bool) *InElement

func (*InElement) Matched

func (this *InElement) Matched(other interface{}) bool

type MatchTable

type MatchTable struct {
	SchemaName        string
	TableName         string
	ColumnNames       []string
	AllColumn         bool
	StartLogFile      string
	StartLogPos       uint64
	EndLogFile        string
	EndLogPos         uint64
	StartRollBackTime string
	EndRollBackTime   string
	ThreadId          uint32
	CalcOp            []interface{}
}

func GetMatchTables

func GetMatchTables(querys string) ([]*MatchTable, error)

func NewMatchTable

func NewMatchTable() *MatchTable

func (*MatchTable) EndPostInfoRatherThan

func (this *MatchTable) EndPostInfoRatherThan(other *MatchTable) bool

结束位点大于其他位点

func (*MatchTable) EndTimeRatherThan

func (this *MatchTable) EndTimeRatherThan(other *MatchTable) (bool, error)

结束时间大于其他位点

func (*MatchTable) HaveEndPosInfo

func (this *MatchTable) HaveEndPosInfo() bool

是否所有结束位点信息

func (*MatchTable) HaveEndTime

func (this *MatchTable) HaveEndTime() bool

是否有结束时间

func (*MatchTable) HaveStartPosInfo

func (this *MatchTable) HaveStartPosInfo() bool

是否有开始位点信息

func (*MatchTable) HaveStartTime

func (this *MatchTable) HaveStartTime() bool

是否有开始事件

func (*MatchTable) StartPosInfoLessThan

func (this *MatchTable) StartPosInfoLessThan(other *MatchTable) bool

开始位点小于其他位点

func (*MatchTable) StartTimeLessThan

func (this *MatchTable) StartTimeLessThan(other *MatchTable) (bool, error)

开始时间小于其他位点

func (*MatchTable) Table

func (this *MatchTable) Table() string

type SelectVisitor

type SelectVisitor struct {
	CurrentNodeLevel int
	TableCnt         int
	Err              error
	MTable           *MatchTable
	PosInfoColCnt    int // 记录 where 位点字段出现的次数
	EliminateOpCnt   int // 还有几个操作符需要消除
}

func NewSelectVisitor

func NewSelectVisitor() *SelectVisitor

func (*SelectVisitor) Enter

func (this *SelectVisitor) Enter(in ast.Node) (out ast.Node, skipChildren bool)

func (*SelectVisitor) Leave

func (this *SelectVisitor) Leave(in ast.Node) (out ast.Node, ok bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL