Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
To rename a column, MariaDB provides this syntax:
ALTER TABLE <table_name> CHANGE COLUMN old_name new_name column_definition |
which requires re-specification of all the attributes of the column.
Disadvantages of the above syntax :
- All the column information might not be available to the application trying to
do the rename. - There is a risk of accidental data type change in the above syntax which might
result in data loss.
The proposed syntax, supported by MySQL 8.0, Oracle and PostgreSQL, is:
ALTER TABLE <table_name> RENAME COLUMN old_name TO new_name; |
The new proposed syntax is expected to behave the same as "ALTER TABLE ...
CHANGE" command used to rename column, without changing column attributes.
The old syntax "ALTER TABLE ... CHANGE" to rename the column will continue
to work.
Attachments
Issue Links
- causes
-
MDEV-23852 alter table rename column to uppercase doesn't work
- Closed
- relates to
-
MDEV-17567 Atomic DDL
- Closed
-
MDEV-7318 RENAME INDEX
- Closed
-
MDEV-21889 IF EXISTS clause does not work for RENAME COLUMN and RENAME INDEX
- Closed
-
MDEV-21941 RENAME doesn't work for system time or period fields
- Closed
-
MDEV-22881 Unexpected errors, corrupt output, Valgrind / ASAN errors in Item_ident::print or append_identifier
- Closed
-
MDEV-28576 RENAME COLUMN with NOCOPY algorithm leads to corrupt partitioned table
- Closed