Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
Description
Note: Even though this is an old known issue not specific to 10.10, I think it becomes much more important now when MDEV-28632 is about to be pushed into 10.10 main; so I'm marking it as 10.10V1 against the standard procedure. Please feel free to adjust both the marking and the priority after deciding what to do about it.
With explicit_defaults_for_timestamp, if a TIMESTAMP column is defined as NOT NULL without a default value, it still partially retains an implicit (only undeclared) logic and gets a current timestamp value if NULL is attempted to be inserted.
Run with --mysqld=--explicit-defaults-for-timestamp=on
CREATE TABLE t (a TIMESTAMP NOT NULL); |
SHOW CREATE TABLE t; |
|
INSERT INTO t VALUES (NULL); |
SELECT * FROM t; |
|
# Cleanup
|
DROP TABLE t; |
10.3 efdbb3cf |
CREATE TABLE t (a TIMESTAMP NOT NULL); |
SHOW CREATE TABLE t; |
Table Create Table |
t CREATE TABLE `t` ( |
`a` timestamp NOT NULL |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
INSERT INTO t VALUES (NULL); |
SELECT * FROM t; |
a
|
2022-06-30 00:34:21
|
Attachments
Issue Links
- relates to
-
MDEV-3929 Add system variable explicit_defaults_for_timestamp for compatibility with MySQL
- Closed
-
MDEV-28632 Change default of explicit_defaults_for_timestamp to ON
- Closed
- links to