Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL)
-
Linux
-
10.1.6-2
Description
Reproduction:
1) Create table
CREATE TABLE `table2` (
|
`i1` INT(10) UNSIGNED NOT NULL,
|
`d1` TIMESTAMP NULL DEFAULT NULL
|
) ENGINE=INNODB;
|
2) Fill table
INSERT INTO table2 (i1) VALUES (1), (2), (3), (4), (5);
|
3) Try Alter table with making field `d1` not nullable with default value CURRENT_TIMESTAMP
ALTER TABLE `table2`
|
CHANGE `d1` `d1` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
|
Error happens here:
Error Code: 1138
|
Invalid use of NULL value
|
Expected that column `d1` will be filled with NOW() value
SELECT @@sql_mode
|
@@sql_mode
|
---------------------------------------------------------------------------------------------------------------------------
|
NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
In continue bug https://mariadb.atlassian.net/browse/MDEV-6880 but also needed with already created fields.
Attachments
Issue Links
- relates to
-
MDEV-12586 ALTER TABLE…ALGORITHM=INPLACE fails with non-constant DEFAULT values
- Closed