
mysql> create table test(a int,b char(20));
Query OK, 0 rows affected (0.09 sec)
mysql> desc test;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
|
+-------+----------+------+-----+---------+-------+
| a | int(11) | YES | |
NULL | |
| b | char(20) | YES | |
NULL | |
+-------+----------+------+-----+---------+-------+
2 rows in set (0.01 sec)

mysql> alter table test rename as test2;
Query OK, 0 rows affected (0.00 sec)
mysql> desc test2;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
|
+-------+----------+------+-----+---------+-------+
| a | int(11) | YES | |
NULL | |
| b | char(20) | YES | |
NULL | |
+-------+----------+------+-----+---------+-------+
2 rows in set (0.01 sec)

mysql> alter table test2 add c int;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc test2;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
|
+-------+----------+------+-----+---------+-------+
| a | int(11) | YES | |
NULL | |
| b | char(20) | YES | |
NULL | |
| c | int(11) | YES | |
NULL | |
+-------+----------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> alter table test2 add d int after a;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc test2;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
|
+-------+----------+------+-----+---------+-------+
| a | int(11) | YES | |
NULL | |
| d | int(11) | YES | |
NULL | |
| b | char(20) | YES | |
NULL | |
| c | int(11) | YES | |
NULL | |
+-------+----------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> alter table test2 drop d;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc test2;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
|
+-------+----------+------+-----+---------+-------+
| a | int(11) | YES | |
NULL | |
| b | char(20) | YES | |
NULL | |
| c | int(11) | YES | |
NULL | |
+-------+----------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> alter table test2 change c d char;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc test2;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
|
+-------+----------+------+-----+---------+-------+
| a | int(11) | YES | |
NULL | |
| b | char(20) | YES | |
NULL | |
| d | char(1) | YES | |
NULL | |
+-------+----------+------+-----+---------+-------+
3 rows in set (0.01 sec)

mysql> alter table test2 change d d int;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc test2;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra
|
+-------+----------+------+-----+---------+-------+
| a | int(11) | YES | |
NULL | |
| b | char(20) | YES | |
NULL | |
| d | int(11) | YES | |
NULL | |
+-------+----------+------+-----+---------+-------+
3 rows in set (0.00 sec)
|