Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove Next() function for MaxOneRowExec #6018

Merged
merged 2 commits into from
Mar 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1140,29 +1140,6 @@ func (e *MaxOneRowExec) Open(ctx context.Context) error {
return nil
}

// Next implements the Executor Next interface.
func (e *MaxOneRowExec) Next(ctx context.Context) (Row, error) {
if !e.evaluated {
e.evaluated = true
srcRow, err := e.children[0].Next(ctx)
if err != nil {
return nil, errors.Trace(err)
}
if srcRow == nil {
return make([]types.Datum, e.schema.Len()), nil
}
srcRow1, err := e.children[0].Next(ctx)
if err != nil {
return nil, errors.Trace(err)
}
if srcRow1 != nil {
return nil, errors.New("subquery returns more than 1 row")
}
return srcRow, nil
}
return nil, nil
}

// NextChunk implements the Executor NextChunk interface.
func (e *MaxOneRowExec) NextChunk(ctx context.Context, chk *chunk.Chunk) error {
chk.Reset()
Expand Down