Bug #79645 On column property, when both 'NOT NULL' and 'NULL' specified, no error throws
Submitted: 15 Dec 2015 9:02 Modified: 15 Dec 2015 11:10
Reporter: Su Dylan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.7.8, 5.5.48, 5.6.28,5.7.10 OS:Any
Assigned to: CPU Architecture:Any

[15 Dec 2015 9:02] Su Dylan
Description:
Output:
=======
mysql> drop table test;
Query OK, 0 rows affected (0.01 sec)

mysql> create table test(c1 timestamp(6) NOT NULL null default now(6));
Query OK, 0 rows affected (0.00 sec)

mysql> desc test;
+-------+--------------+------+-----+----------------------+-------+
| Field | Type         | Null | Key | Default              | Extra |
+-------+--------------+------+-----+----------------------+-------+
| c1    | timestamp(6) | YES  |     | CURRENT_TIMESTAMP(6) |       |
+-------+--------------+------+-----+----------------------+-------+
1 row in set (0.01 sec)

mysql>  select version();
+-----------+
| version() |
+-----------+
| 5.7.8-rc  |
+-----------+
1 row in set (0.00 sec)

Problem:
========
On column property, when both 'NOT NULL' and 'NULL' specified, no error throws.
The 'NULL' is taking effect, while 'NOT NULL' is not.

How to repeat:

drop table test;
create table test(c1 timestamp(6) NOT NULL null default now(6));
desc test; 
 

Suggested fix:
On column property, when both 'NOT NULL' and 'NULL' specified, it should not be allowed.
[15 Dec 2015 11:10] MySQL Verification Team
Hello Su Dylan,

Thank you for the report.
Observed this with 5.5.48, 5.6.28 and 5.7.10 builds.

Thanks,
Umesh