Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3, 10.4, 10.3.37, 10.4.27, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
-
None
-
Ubuntu 18.04.1 LTS, Ubuntu 20.04.5 LTS
Description
Applying an online change for a column from NULL to NOT NULL using a constant default value fails with a "cannot convert NULL to non-constant DEFAULT".
CREATE TABLE `test_seb` ( |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`created` timestamp NULL DEFAULT NULL, |
PRIMARY KEY (`id`), |
KEY `created` (`created`) |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
|
ALTER TABLE test_seb MODIFY created timestamp NOT NULL DEFAULT '2000-01-01 00:00:00', ALGORITHM=INPLACE; |
|
/* Error:
|
SQL Error [1846] [0A000]: (conn:248597) ALGORITHM=INPLACE is not supported. Reason: cannot convert NULL to non-constant DEFAULT. Try ALGORITHM=COPY
|
*/ |
Trying to apply a constant default before applying the NOT NULL change does not change the behavior.