Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
2025-9
Description
- `t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
+ `t` timestamp NULL DEFAULT NULL,
|
checked manually with InnoDB table:
11.4:
|
MariaDB [t]> CREATE TABLE t1 (i INTEGER) engine=innodb;
|
Query OK, 0 rows affected (0.008 sec)
|
|
MariaDB [t]> ALTER TABLE t1 ADD COLUMN (c CHAR(10));
|
Query OK, 0 rows affected (0.007 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [t]> INSERT INTO t1 VALUES (1, 'a'),(2, 'b');
|
Query OK, 2 rows affected (0.004 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [t]> ALTER TABLE t1 ADD t TIMESTAMP;
|
Query OK, 0 rows affected (0.006 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [t]> SHOW CREATE TABLE t1;
|
+-------+--------------+
|
| Table | Create Table |
|
+-------+--------------+
|
| t1 | CREATE TABLE `t1` (
|
`i` int(11) DEFAULT NULL,
|
`c` char(10) DEFAULT NULL,
|
`t` timestamp NULL DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci |
|
+-------+--------------+
|
1 row in set (0.000 sec)
|
|
10.6:
MariaDB [t]> CREATE TABLE t1 (i INTEGER) engine=innodb;
|
Query OK, 0 rows affected (0,010 sec)
|
|
MariaDB [t]> ALTER TABLE t1 ADD COLUMN (c CHAR(10));
|
Query OK, 0 rows affected (0,015 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [t]> INSERT INTO t1 VALUES (1, 'a'),(2, 'b');
|
Query OK, 2 rows affected (0,007 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [t]> ALTER TABLE t1 ADD t TIMESTAMP;
|
Query OK, 0 rows affected (0,014 sec)
|
Records: 0 Duplicates: 0 Warnings: 0
|
|
MariaDB [t]> SHOW CREATE TABLE t1;
|
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| t1 | CREATE TABLE `t1` (
|
`i` int(11) DEFAULT NULL,
|
`c` char(10) DEFAULT NULL,
|
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci |
|
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
1 row in set (0,002 sec)
|
|
11.4 does not add `DEFAULT current_timestamp() ON UPDATE current_timestamp()` by default
Attachments
Issue Links
- relates to
-
MCOL-5948 Failed tests for 11.4
-
- Closed
-