-
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
plan, executor: check b.err after buildSort and buildLimit in builUnion #7114
Conversation
LGTM |
/run-all-tests |
if b.err != nil { | ||
b.err = errors.Trace(b.err) | ||
return nil | ||
} |
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.
I have an idea how about extract this part to this style.
package main
import (
"github.com/juju/errors"
"fmt"
)
type builder struct {
err error
}
func (b *builder) b1() {
b.b2()
b.traceSelfCallStack()
return
}
func (b *builder) b2() {
b.err = errors.New("111")
return
}
func (b *builder) traceSelfCallStack() {
if b.err == nil {
return
}
err := errors.NewErrWithCause(b.err, "")
err.SetLocation(2)
b.err = &err
return
}
and still, keep every builder self-call has a b.traceSelfCallStack()
followed..(we have no generic, so we can not b.selfCall(b.b2)()
which is more readable)
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
/run-integration-ddl-test |
What have you changed? (mandatory)
Before this commit, b.err is not checked after buildSort and buildLimit in buildUnion.
What is the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
integration test
Does this PR affect documentation (docs/docs-cn) update? (mandatory)
no
Does this PR need to be added to the release notes? (mandatory)
no
Refer to a related PR or issue link (optional)
Benchmark result if necessary (optional)
Add a few positive/negative examples (optional)