Bug #61165 Database synchronization discards double(m,d)
Submitted: 13 May 2011 10:48 Modified: 20 Jan 2012 7:37
Reporter: William Ledda Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.31, 5.2.33b OS:Windows
Assigned to: CPU Architecture:Any
Tags: double, synchronization

[13 May 2011 10:48] William Ledda
Description:
When you have a table with some columns like DOUBLE(M,D) the data model synchronization discards the (M,D) specification.

If you update the model during synchornization, fields like DOUBLE(M,D) will be converted to DOUBLE(11) loosing (M,D) specification. From now model and database will be "synchronized" even if in the database they are double(M,D) and in the model they are double(11).

If you update the source (database) model and database will be always "not synch" and you have to check always what is different.

How to repeat:
CREATE TABLE `sensor` (
  `SENSOR_ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `MANUFACTURER` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `PN` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `SN` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `MIN_VAL` double(14,4) NOT NULL DEFAULT '0.0000',
  `MAX_VAL` double(14,4) NOT NULL DEFAULT '0.0000',
  PRIMARY KEY (`SENSOR_ID`),
  ....
  );

Synchronize the model: MIN_VAL and MAX_VAL are created as DOUBLE(11) in the model.
[13 May 2011 10:59] Valeriy Kravchuk
Please, check if the problem happens with a newer version, 5.2.33b.
[16 May 2011 7:26] William Ledda
Yes, the problem still remains with the version 5.2.33b
I don't know about previous versions and other OS.

I've note that in the table editor (from "SQL Editor") the type appears alwasy as DOUBLE even if in the db is double(m,d).
[16 May 2011 8:45] Valeriy Kravchuk
Verified just as described on Windows XP, while working with server version 5.1.56.
[16 May 2011 9:48] William Ledda
Just for completeness, I'm using Mysql 5.1.52 on Windows.
[24 May 2011 9:07] Valeriy Kravchuk
Bug #61273 was marked as a duplicate of this one.
[3 Jun 2011 14:24] Erick Oliveira
I have similar scenario, wich even declaring a column just with "DOUBLE", when synchronizing(and forward engineering) the resulting script shows me "DOUBLE(11)"
[19 Jun 2011 8:14] Tomoya Kabe
It also happens 5.2.34 (rev 7780) on Linux.
I configured just "DOUBLE" but "DOUBLE(11)" generated.
[29 Aug 2011 13:51] William Ledda
Hey! Any news about this bug? It's very tedious synchronize models with this bug!
[6 Oct 2011 1:29] Ezequiel Muns
This is confirmed as happening on 5.2.34 against server 5.1.41. Have tried everything to work around it. 

If I reverse engineer from a table with a double(11,2) column, the model ends up with a double(11) column, so that's in addition to forward engineering and synchronizing.
[12 Oct 2011 11:47] Jan W. Hentsch
Hello,

I just want to commit, that we have the same Problem with WB-Version 5.2.35 running on MacOSX and on WIN7. We synched against several MySQL-DB-Versions, always the same. As soon we let a DB sync back to a Model all DOUBLE(m,d) get wrong DOUBLE(11) wich will than produce errors on the next sync from Model to any DB-Server.

cu jwh
[20 Jan 2012 7:37] Philip Olson
Fixed as of 5.2.38:

When a table had columns like DOUBLE(M,D), the data model 
synchronization would discard the (M,D) specification, and 
convert the columns to DOUBLE(11).