Esempio n. 1
0
// Order
func (this *builder) VisitOrder(plan *plan.Order) (interface{}, error) {
	if plan.LimitPushed() {
		return NewOrderLimit(plan), nil
	} else {
		return NewOrder(plan), nil
	}
}
Esempio n. 2
0
func NewOrderLimit(plan *plan.Order) *OrderLimit {
	var rv *OrderLimit
	if plan.Offset() == nil {
		rv = &OrderLimit{
			Order:            *NewOrder(plan),
			offset:           nil,
			limit:            NewLimit(plan.Limit()),
			numReturnedRows:  0,
			fallbackNum:      plan.FallbackNum(),
			ignoreInput:      false,
			fallback:         false,
			numProcessedRows: 0,
		}
	} else {
		rv = &OrderLimit{
			Order:            *NewOrder(plan),
			offset:           NewOffset(plan.Offset()),
			limit:            NewLimit(plan.Limit()),
			numReturnedRows:  0,
			fallbackNum:      plan.FallbackNum(),
			ignoreInput:      false,
			fallback:         false,
			numProcessedRows: 0,
		}
	}

	rv.output = rv
	return rv
}