Bug #73265 SQL Editor activates NN on PK without clearing a non-empty DEFAULT value.
Submitted: 10 Jul 2014 19:08 Modified: 11 Jul 2014 8:01
Reporter: Pedro Garcia Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:6.1.7 OS:Mac OS X (10.9.3)
Assigned to: CPU Architecture:Any
Tags: sql editor

[10 Jul 2014 19:08] Pedro Garcia
Description:
Having a table created, if one alters a table field to a Primary Key (PK) it automatically sets the Not Null (NN) to active. The problem is if there is a DEFAULT clause to NULL, it isn’t reset.
When saving the changes, it reports a non existing database error.

How to repeat:
1. create a table with some fields on the SQL Editor, with default values, and apply it to the server;
2. alter the table in the SQL Editor and make one of the existing fields a PK;
2.1 it will set the NN flag but won’t empty a DEFAULT value if not empty;
3. apply (will return a non descriptive error)

Suggested fix:
When a field is set to PK and the NN is activated, clear the DEFAULT value if not empty.
[11 Jul 2014 8:01] Umesh Shastry
Hello Pedro,

Thank you for the report.
Verified as described on OL6 with WB 6.1.7.

Thanks,
Umesh