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

ddl: rename a non exist table report right error message(issue:#29893) #32144

Closed
wants to merge 4 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions executor/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

@xiongjiwei xiongjiwei Feb 8, 2022

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.

err = domain.GetDomain(e.ctx).DDL().RenameTable(e.ctx, oldIdent, newIdent, isAlterTable)
} else {
oldIdents := make([]ast.Ident, 0, len(s.TableToTables))
Expand Down