-
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
ddl: rename a non exist table report right error message(issue:#29893) #32144
Conversation
…essage Signed-off-by: fanrenhoo <[email protected]>
[REVIEW NOTIFICATION] This pull request has not been approved. 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. |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
After you have format title, you can leave a comment |
/cc @xiongjiwei |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
After you have format title, you can leave a comment |
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
After you have format title, you can leave a comment |
please follow the comment, the PR title should be like |
@@ -240,6 +240,7 @@ func (e *DDLExec) executeRenameTable(s *ast.RenameTableStmt) error { | |||
return ddl.ErrUnsupportedLocalTempTableDDL.GenWithStackByArgs("RENAME TABLE") | |||
} | |||
newIdent := ast.Ident{Schema: s.TableToTables[0].NewTable.Schema, Name: s.TableToTables[0].NewTable.Name} | |||
isAlterTable := true |
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 point is the error message is not the same with MySQL. We'd better change the error message.
BTW, in the previous code, isAlterTable
is always false. I think it can be removed. you can see the commit which introduced this variable.
please also add a test for this case |
Signed-off-by: fanrenhoo [email protected]
What problem does this PR solve?
Issue Number: close #29893
Problem Summary:
What is changed and how it works?
in executor/ddl.go, in "func (e *DDLExec) executeRenameTable"
add new line:243 "isAlterTable := true"
in this "if branch" should be a altertable case, so set this value to "true"
I tested in my local branch, it worked, like:
Check List
executor/ddl.go
Tests
I tested in my local branch, before fix its like what the issue described, now it worked:
the steps is as:
Side effects
should no side effect
Documentation
nothing change to Documentation
Release-note
/cc @xiongjiwei