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

Why there's no return in SelectStmt.Restore #224

Closed
loxp opened this issue Feb 27, 2019 · 1 comment
Closed

Why there's no return in SelectStmt.Restore #224

loxp opened this issue Feb 27, 2019 · 1 comment

Comments

@loxp
Copy link
Contributor

loxp commented Feb 27, 2019

Question

func (n *SelectStmt) Restore(ctx *RestoreCtx) error {
        ......
	if n.TableHints != nil && len(n.TableHints) != 0 {
		ctx.WritePlain("/*+ ")
		for i, tableHint := range n.TableHints {
			if err := tableHint.Restore(ctx); err != nil {
				errors.Annotatef(err, "An error occurred while restore SelectStmt.TableHints[%d]", i)
			}
		}
		ctx.WritePlain("*/ ")
	}
        ......
}

Why not return errors.Annotatef()? If error occurs, the error will disappear and cannot be found in return value.

@kennytm
Copy link
Contributor

kennytm commented Feb 27, 2019

This looks like a typo. Would you mind filing a PR fixing this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants