-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
planner: fix create binding panic when status.record-db-qp enable #29519
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
@@ -453,6 +453,10 @@ func (p *preprocessor) checkBindGrammar(originNode, hintedNode ast.StmtNode, def | |||
p.err = ddl.ErrOptOnTemporaryTable.GenWithStackByArgs("create binding") | |||
return | |||
} | |||
tableInfo := tbl.Meta() | |||
dbInfo, _ := p.ensureInfoSchema().SchemaByTable(tableInfo) |
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 handle this error?
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 second return value is not an error. It means whether we can find the table. We have already checked this.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: c54e43f
|
/run-all-tests |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.3 in PR #29574 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.2 in PR #30371 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0 in PR #30372 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.1 in PR #30373 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #30374 |
What problem does this PR solve?
Issue Number: close #29503
Problem Summary:
nil
forast.SelectStmt.From
. When we create the empty table query, it will cause panic. E.g,select 1
.tableInfo
anddbInfo
toast.StmtNode
when we create the binding and the config record-db-qps enable.nil
ingetStmtDbLabel
function for*ast.CreateBindingStmt
, it will cause panic when the table is empty.What is changed and how it works?
nil
forast.SelectStmt.From
.tableInfo
anddbInfo
toast.StmtNode
when we create the binding and the config record-db-qps enable.nil
ingetStmtDbLabel
function for*ast.CreateBindingStmt
.Check List
Tests
Side effects
Documentation
Release note