[MDEV-8392] Couldn't alter field with default value for make it not nullable. Created: 2015-06-28 Updated: 2017-05-08 Resolved: 2015-06-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.0, 10.1 |
| Fix Version/s: | 10.0.21, 10.1.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Mikhail Gavrilov | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream | ||
| Environment: |
Linux |
||
| Issue Links: |
|
||||||||
| Sprint: | 10.1.6-2 | ||||||||
| Description |
|
Reproduction: 1) Create table
2) Fill table
3) Try Alter table with making field `d1` not nullable with default value CURRENT_TIMESTAMP
Error happens here:
Expected that column `d1` will be filled with NOW() value
In continue bug https://mariadb.atlassian.net/browse/MDEV-6880 but also needed with already created fields. |
| Comments |
| Comment by Elena Stepanova [ 2015-06-29 ] | |||||||||||||||||||||||||||||
|
Thanks for the report. jplindst, | |||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2015-06-29 ] | |||||||||||||||||||||||||||||
|
Based on manual about alter table syntax it should be:
But at least on 10.1 both are accepted and result is correct i.e. d1 has value NOW(). | |||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-06-29 ] | |||||||||||||||||||||||||||||
|
Yes, I tried to switch 'NOT NULL' and 'DEFAULT', it does not make a difference.
| |||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2015-06-30 ] | |||||||||||||||||||||||||||||
|
commit 1a8cf15d63230a84e6d4dfac8011008e1331994f Analysis; Problem is that InnoDB does not have support for generating Fix: Add additional check if column has changed from NULL -> NOT NULL |