示例#1
0
文件: builder.go 项目: anywhy/tidb
func (b *executorBuilder) buildLimit(v *plan.Limit) Executor {
	src := b.build(v.GetChildByIndex(0))
	e := &LimitExec{
		Src:    src,
		Offset: v.Offset,
		Count:  v.Count,
		schema: v.GetSchema(),
	}
	return e
}
示例#2
0
文件: builder.go 项目: c4pt0r/tidb
func (b *executorBuilder) buildLimit(v *plan.Limit) Executor {
	src := b.build(v.GetChildByIndex(0))
	if x, ok := src.(NewXExecutor); ok {
		if x.AddLimit(v) && v.Offset == 0 {
			return src
		}
	}
	e := &LimitExec{
		Src:    src,
		Offset: v.Offset,
		Count:  v.Count,
		schema: v.GetSchema(),
	}
	return e
}