Bug #84396 Workbench does not recognize a table with generated field in the DB
Submitted: 3 Jan 2017 19:55 Modified: 9 Feb 2017 13:45
Reporter: Marco Antonio Abreu Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:6.3.8 OS:Windows (Microsoft Windows 10 Home Single Language)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[3 Jan 2017 19:55] Marco Antonio Abreu
Description:
I created manually a generated field in an already existent table. This table is already in a model, but after this modification Workbench does not recognize this table in the database any more.

How to repeat:
Create a table in a model, sync it with the database. Verify if the table was created well. Them try to sync again. The table in the database will not appear to Workbench, it "thinks" the table does not exists.

You can create this table manually and them try to syncronize the model.
[5 Jan 2017 6:15] Chiranjeevi Battula
Hello Marco,

Thank you for the bug report.
I could not see any issues in table creation through model and synchronize model to database using MySQL workbench 6.3.8 version.
Could you please provide us create table statements, screenshots (please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[5 Jan 2017 6:15] Chiranjeevi Battula
Screenshot

Attachment: 84396.JPG (image/jpeg, text), 102.76 KiB.

[6 Feb 2017 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[9 Feb 2017 12:08] Chiranjeevi Battula
Hello Marco,

Thank you for your feedback.
I could not repeat the issue at our end using with MySQL workbench 6.3.9 version.
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Thanks,
Chiranjeevi.
[9 Feb 2017 13:45] Marco Antonio Abreu
Hi, Chiranjeevi.

I installed the version 6.3.9 but the problem continues to occur. You can try to reproduce this problem creating the table like the command below. I did it creating the table in an ER diagram, saving it on disk and synchronizing with a schema creating the table in the schema. Then I tried to synchronize again and Workbench showed again that is necessary to create the table in the schema.  

Also, you can try creating the table with the console and then synchronize any ER diagram with the schema. In this case the table will not appear to be synchornized with the ER diagram, it's like it doesn't exists in the schema.

CREATE TABLE `tributos` (
  `uf` char(2) NOT NULL,
  `dt_ini_vigencia` date NOT NULL,
  `dt_fim_vigencia` date DEFAULT NULL,
  `aliq_icms` decimal(4,2) NOT NULL,
  `aliq_pis` decimal(4,2) NOT NULL,
  `aliq_cofins` decimal(4,2) NOT NULL,
  `aliq_fust` decimal(4,2) NOT NULL,
  `aliq_funttel` decimal(4,2) NOT NULL,
  `fator` decimal(5,4) GENERATED ALWAYS AS ((1.0 / (1.0 - (((`aliq_icms` + `aliq_pis`) + `aliq_cofins`) / 100)))) VIRTUAL,
  PRIMARY KEY (`uf`,`dt_ini_vigencia`)
) ENGINE=InnoDB;

Thanks for you help.
Marco
[5 Aug 2020 1:35] Rakesh R
I had the same issue.
Once i unmark the field as "generated", the table is picked up during synchronization.

using 6.3.8 build 1228 CE