Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL)
Description
Set to Minor because only 10.2 and 10.3 are affected.
CREATE TABLE t (b TEXT NOT NULL); |
ALTER TABLE t ALTER b SET DEFAULT NULL; |
SHOW CREATE TABLE t; |
The ALTER is obviously wrong, as it attempts to set the default value to NULL while the column is not null. But it works, and the resulting table is this:
10.2 676987c4 |
CREATE TABLE `t` ( |
`b` text NOT NULL DEFAULT NULL |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
Reproducible on 10.2-10.3.
Not reproducible on 10.4-10.6.
An attempt to execute this CREATE statement on any version, including the affected ones, expectedly ends with an error:
query 'CREATE TABLE `t` ( |
`b` text NOT NULL DEFAULT NULL
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
' failed: 1067: Invalid default value for 'b' |