Bug #38081 SQL code generation issue (DEFAULT NULL)
Submitted: 12 Jul 2008 23:31 Modified: 3 Aug 2008 18:05
Reporter: Dmitry Berestnev Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.23 OS:Windows (XP SP3)
Assigned to: CPU Architecture:Any

[12 Jul 2008 23:31] Dmitry Berestnev
Description:
The system generate DEFAULT NULL code where it mustn't be.

Well, i don't set the DEFAULT value in editor(empty field), also i set 'not null' specifier, but the system generate 'not null default null', that is wrong sql code. But it isn't regular error:

  `nationality` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL DEFAULT NULL COMMENT 'Национальность' ,
  `birth_place` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL DEFAULT NULL COMMENT 'Место рождения' ,
  `arrived_from` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL COMMENT 'Откуда и когда прибыл' ,

As you can see here, nationality and birth_place fields generates with DEFAULT NULL, but arrived_from without it.
In editor, all of this fields was designed the same (empty default field).

Note: nationality and birth_place was imported from SQL script with Reverse Engineering.

Also, if i set some text in default value for ex. nationality field, generated code will keep contain 'default null' expression.

How to repeat:
Well, i don't know how to repeat it.
[12 Jul 2008 23:39] Dmitry Berestnev
Note: I'm generate SQL script with 'Forward Engineering SQL CREATE Script', 'Generate INSERT statements for table' option only.
[3 Aug 2008 18:05] Sveta Smirnova
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Duplicate of bug #37385