-
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: add support for renaming columns #14281
Conversation
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.
Test if it affects objects that reference to this column. E.g. generated columns, indexes, views.
Does the view definition(show create view
) updates?
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.
There's no lock in renaming column, what happens if another thread is adding a column with the same name?
I think the ddl job queue would do the synchronization. |
|
||
// Test renaming generated columns. | ||
s.tk.MustExec("drop table test_rename_column") | ||
s.tk.MustExec("create table test_rename_column (id int, col1 int generated always as (id + 1))") |
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 mean, rename id
, not col1
, because col1
refers to id
.
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. PTAL
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 |
LGTM |
/run-all-tests |
lgtm |
/merge |
/run-all-tests |
What problem does this PR solve?
Fix #10195.
What is changed and how it works?
Add
rename column
in DDL.Check List
Tests
Code changes
Side effects
Related changes
Release note