[MDEV-11428] Inconsistent Alter column / modify column behavior Created: 2016-11-30 Updated: 2016-11-30 Resolved: 2016-11-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 10.1.19 |
| Fix Version/s: | 10.2.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marcin Gryszkalis | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
CURRENT_TIMESTAMP can be set as DEFAULT with MODIFY but not with ALTER: > ALTER TABLE attachment_version ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CURRENT_TIMESTAMP' at line 1 > ALTER TABLE attachment_version MODIFY COLUMN created_at timestamp DEFAULT CURRENT_TIMESTAMP; Query OK, 0 rows affected (0.02 sec) The table in example is InnoDB. |
| Comments |
| Comment by Elena Stepanova [ 2016-11-30 ] | ||||||||||||
|
It was a documented limitation, both in MariaDB and MySQL:
However, in 10.2 the limitation has been already lifted:
|