Bug #65201 Workbench not showing Default Value from Table/Field correctly
Submitted: 4 May 2012 11:58 Modified: 15 May 2012 9:13
Reporter: Michael Loney Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.39 CE OS:Windows (Windows 7 64bit)
Assigned to: CPU Architecture:Any

[4 May 2012 11:58] Michael Loney
Description:
Viewing a Table structure in Model View, and a field Default Value is shown as 20.00.

When Field examined using the following SQL, the Default Value is shown as NULL!

i.e the Model View is not correctly showing Table/Field Defaults.

SQL Applied:
    SELECT
    INFORMATION_SCHEMA.TABLES.TABLE_TYPE,
    INFORMATION_SCHEMA.TABLES.TABLE_NAME,
    INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME,
    INFORMATION_SCHEMA.COLUMNS.DATA_TYPE,
    INFORMATION_SCHEMA.COLUMNS.CHARACTER_MAXIMUM_LENGTH AS "Max Characters",
    INFORMATION_SCHEMA.COLUMNS.NUMERIC_PRECISION,
    INFORMATION_SCHEMA.COLUMNS.NUMERIC_SCALE,
    INFORMATION_SCHEMA.COLUMNS.COLUMN_DEFAULT AS "Default Value"
    FROM INFORMATION_SCHEMA.TABLES, INFORMATION_SCHEMA.COLUMNS
    WHERE INFORMATION_SCHEMA.TABLES.TABLE_NAME = INFORMATION_SCHEMA.COLUMNS.TABLE_NAME
    ORDER BY INFORMATION_SCHEMA.TABLES.TABLE_TYPE, INFORMATION_SCHEMA.TABLES.TABLE_NAME, INFORMATION_SCHEMA.COLUMNS.ORDINAL_POSITION

How to repeat:
Using Data Modelling Tab, double click on the Database to open it in a Model View Window. Double click on a Table in topmost screen, and its data structure is shown in bottom screen. Move to Columns Tab, and structure of each column is neatly laid out, with details of default Value setting, if any, that are set for each field.

Modifying this default value in the Table Editor, does not get applied to the Table, but is remembered by the Table editor, so the 'modified' value appears next time WB run and same table examined

If the above SQL is run, it will show field default value has not changed.

i.e. The table editor and underlying table show different default values for the same filed.
[4 May 2012 12:01] Michael Loney
Initial submission had wrong Severity
[15 May 2012 9:13] Michael Loney
My misunderstanding of what Workbench was telling me!