-
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
ddl: fix duplicate inforSchema information of rename tables #47087
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1377,9 +1377,13 @@ func updateSchemaVersion(d *ddlCtx, t *meta.Meta, job *model.Job, multiInfos ... | |
if err != nil { | ||
return 0, errors.Trace(err) | ||
} | ||
affects := make([]*model.AffectedOption, len(newSchemaIDs)) | ||
affects := make([]*model.AffectedOption, len(newSchemaIDs)-1) | ||
for i, newSchemaID := range newSchemaIDs { | ||
affects[i] = &model.AffectedOption{ | ||
// Do not add the first table to AffectedOpts. Related issue tidb#47064. | ||
if i == 0 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we not change these codes and remove line1393-1295 to fix it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am afaid it can't work if we just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it can be fixed, but it does have potential risks. We may need to remove "applyTableUpdate" like "applyCreateTables" for safety. Or we can do this according to your PR first, and then do unification. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. We can fix the bug first. |
||
continue | ||
} | ||
affects[i-1] = &model.AffectedOption{ | ||
SchemaID: newSchemaID, | ||
TableID: tableIDs[i], | ||
OldTableID: tableIDs[i], | ||
|
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.
Please add a comment for it.
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.
Done.