-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
executor: MaxOneRow operator should keep its promise #7375
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REST LGTM
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} | ||
|
||
childChunk := e.children[0].newChunk() | ||
err = e.children[0].Next(ctx, childChunk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check this error?
What problem does this PR solve?
When the child of
MaxOneRow
operator returns a chunk with only one row, we should check whether the child has more result by calling thechild.Next
again. In the before, this validation was not employed.Before this PR, when we set
tidb_max_chunk_size
to1
, the behavior is wrong:What is changed and how it works?
In this PR, when the first
Chunk
returned from the child, if the number of records is not equal to 1, we return an error about "subquery returns more than 1 row", Otherwise we calle.children[0].Next
again to check whether there are more records existed in the child operator.Check List
Tests
Code changes
Related changes