Bug #38932 '0' default values are dropped
Submitted: 21 Aug 2008 9:56 Modified: 21 Aug 2008 11:09
Reporter: Vincent Courcelle Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.0.24 OS:Any
Assigned to: CPU Architecture:Any
Tags: 0, DEFAULT, Drop, values

[21 Aug 2008 9:56] Vincent Courcelle
When entering a default value of "0" for a not null, double or int table field, the default value is lost when closing and then reopening the file.

The bug occurs when you put '0' or 0 in the default value column.

This cause further problems with the program running over the database (the column don't have default value...), causing the database software to be nearly unusable when a lot of affected tables...

How to repeat:
Create a new table schema with a new table, add an int field with default value '0', close and the reopen the program: the default value disappeard.
[21 Aug 2008 9:58] Vincent Courcelle
Well, I guess there is an error in my schema file because I can't actually set any default value to my fields...
[21 Aug 2008 10:05] Vincent Courcelle
The default value is saved but not restored on the opening of the file, doing this to every table, causing the schema to become invalid (grrrrrr I will have to check back all my tables once the bug will be repaired!!!!)

<value type="object" struct-name="db.mysql.Column" id="{71156825-9044-4AB5-A3A8-41D55C5A7147}" struct-checksum="0xd3ccec73">
                      <value type="int" key="autoIncrement">0</value>
                      <value type="string" key="characterSetName"></value>
                      <value _ptr_="0AE12C08" type="list" content-type="object" content-struct-name="db.CheckConstraint" key="checks"/>
                      <value type="string" key="collationName"></value>
                      <value type="string" key="comment"></value>
                      <value type="string" key="datatypeExplicitParams"></value>
                      <value type="string" key="defaultValue">1234567</value>
                      <value type="int" key="defaultValueIsNull">0</value>
                      <value _ptr_="0AE12D88" type="list" content-type="string" key="flags"/>
                      <value type="int" key="isNotNull">1</value>
                      <value type="int" key="length">-1</value>
                      <value type="string" key="name">Amount</value>
                      <value type="string" key="oldName">Amount</value>
                      <link type="object" struct-name="db.mysql.Table" key="owner">{CE713114-BA9B-48FB-B2B8-F5BB2F424DEE}</link>
                      <value type="int" key="precision">11</value>
                      <value type="int" key="scale">2</value>
                      <link type="object" struct-name="db.SimpleDatatype" key="simpleType">com.mysql.rdbms.mysql.datatype.double</link>
[21 Aug 2008 10:08] Vincent Courcelle
The bug wasn't present in 5.0.23, going back to this version
[21 Aug 2008 11:09] Miguel Solorzano
Thank you for the bug report. Duplicate of bug: http://bugs.mysql.com/bug.php?id=38825