-
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, executor: fix rename table compatibility #8709
Conversation
@@ -122,7 +122,8 @@ func (e *DDLExec) executeRenameTable(s *ast.RenameTableStmt) error { | |||
} | |||
oldIdent := ast.Ident{Schema: s.OldTable.Schema, Name: s.OldTable.Name} | |||
newIdent := ast.Ident{Schema: s.NewTable.Schema, Name: s.NewTable.Name} | |||
err := domain.GetDomain(e.ctx).DDL().RenameTable(e.ctx, oldIdent, newIdent) | |||
isAlterTable := false | |||
err := domain.GetDomain(e.ctx).DDL().RenameTable(e.ctx, oldIdent, newIdent, isAlterTable) |
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.
Why not pass false directly?
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.
Agree.
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.
This makes it more readable.
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.
I don't think it is necessary.
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.
It's an interesting behavior on MySQL.
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.
reset LGTM
1 similar comment
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
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
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
/run-all-tests |
What problem does this PR solve?
The results of
alter table old_name rename new_name
andrename table old_name to new_name
are different.What is changed and how it works?
We treat
alter table old_name rename new_name
andrename table old_name to new_name
differently.Check List
Tests
Code changes
Related changes
This change is