-
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: refactor errors #6377
plan: refactor errors #6377
Conversation
/go/src/github.com/pingcap/tidb/plan/errors.go:50:2: exported var ErrUnsupportedType should have comment or be unexported |
executor/prepared_test.go
Outdated
@@ -260,5 +260,5 @@ func (s *testSuite) TestPreparedNameResolver(c *C) { | |||
tk.MustExec("create table t (id int, KEY id (id))") | |||
tk.MustExec("prepare stmt from 'select * from t limit ? offset ?'") | |||
_, err := tk.Exec("prepare stmt from 'select b from t'") | |||
c.Assert(err.Error(), Equals, "[plan:1054]Unknown column 'b' in 'field list'") | |||
c.Assert(err.Error(), Equals, "[optimizer:1054]Unknown column 'b' in 'field list'") |
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.
planner?
/run-all-tests |
/run-common-test |
plan/expression_rewriter.go
Outdated
@@ -1177,7 +1177,7 @@ func (er *expressionRewriter) funcCallToExpression(v *ast.FuncCallExpr) { | |||
func (er *expressionRewriter) toColumn(v *ast.ColumnName) { | |||
column, err := er.schema.FindColumn(v) | |||
if err != nil { | |||
er.err = ErrAmbiguous.GenByArgs(v.Name) | |||
er.err = ErrAmbiguous.GenByArgs(v.Name, "field list") |
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.
s/ "field list"/ clauseMsg[fieldList]
so as the others.
@@ -774,14 +774,14 @@ func (b *planBuilder) buildLimit(src LogicalPlan, limit *ast.Limit) LogicalPlan | |||
if limit.Offset != nil { | |||
offset, err = getUintForLimitOffset(sc, limit.Offset.GetValue()) | |||
if err != nil { | |||
b.err = ErrWrongArguments | |||
b.err = ErrWrongArguments.GenByArgs("LIMIT") |
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.
add test case for this in TestNameResolver?
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.
the Offset
and Count
of ast.Limit
is guaranteed to be a value of uint64
by parser, maybe we should delete this check.
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.
But if offset and count are paramMarker, they are not guaranteed to be uint64.
LGTM |
@winoros PTAL |
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
@zz-jason Please fix the confliction |
@zimulala done, PTAL |
/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
errors.go
terror.ClassOptimizerPlan