Bug #36250 INSERT-Editor does not set a column to NULL - differs from table definition
Submitted: 22 Apr 2008 12:00 Modified: 16 Oct 2009 7:34
Reporter: Dennis Becker Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.19 OS:Windows (XP)
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: CHECKED, INSERT-Editor, table definition

[22 Apr 2008 12:00] Dennis Becker
Description:
When you want to insert rows to a table with the INSERT-Editor, it does not recognize that you have set a default value or sets the wrong value.

For example I have created a table with the following columns:

id INT NOT NULL AUTO_INCREMENT,
parentID INT NULL Default NULL
active BOOLEAN (or TINYINT(1)) NOT NULL Default 0

The INSERT-Editor does not set the right default values in the columns. for "parentID" it sets to 0, for "active" it sets it to NULL. Also you have to set manually the PRIMARY KEY id for each row, which is not a "must" in MySQL.

How to repeat:
Create a new table definition, for example the definition I mentioned in the "Description" field. INSERT some rows.

Suggested fix:
Check the table definition for the default value and set it foreach new row as default. Set also automatically the new primary key index.
[22 Apr 2008 12:20] MySQL Verification Team
Thank you for the bug report.
[23 Apr 2008 7:49] Johannes Taxacher
somehow similar or connected to http://bugs.mysql.com/bug.php?id=36206
[14 May 2008 11:23] Johannes Taxacher
INSERT editor should insert DEFAULT for AI columns if not specified by user.
[16 Oct 2009 7:34] Susanne Ebrecht
This is a duplicate of bug #36206