Bug #104568 Virtual columns in a table are always VIRTUAL even though STORED is selected
Submitted: 8 Aug 2021 20:23 Modified: 9 Aug 2021 5:39
Reporter: Ignacio Zamora Email Updates:
Status: Verified Impact on me:
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:8.0.26 OS:Windows (Windows 10)
Assigned to: CPU Architecture:x86 (x64)
Tags: virtual generated stored

[8 Aug 2021 20:23] Ignacio Zamora

After 6 months working with MySQL Workbench to model databases, this is the first time I had to design generated/calculated column inside a table.

The process to do it was so easy that I didn't think at the time that was a problem with it.

So, as soon as I flag the desired column as a "Generated Column" (with the checkbox labeled as "G"), the Storage options are enabled and I can choose either Virtual or Stored.

The column I want to be generated depends on columns which are not going to change that much, so Stored would be my choice.

If I don't close the Edit Table with the generated column selected and I synchronize the Database with the new changes by going to Database -> Synchronize Model, the database will pickup the new column adition just fine.

However, no matter how many times I save the model, if I close the Edit Table view and I reopen it again, the generated column will show under the Storage options that it's been flagged as VIRTUAL rather than STORED which is the option I choose previously.

This has an impact in my development workflow since I use a lot the Synchronize Model option to update the database whenever I update the model, and it seems everytime I generate a synchronize the database with the model, will pickup the column change from STORED to VIRTUAL back again.

So I will say the STORAGE option for generated columns is not saved.

How to repeat:
Create table
Create column
Mark the created column as "Generated Column"
Under the Storage options, select STORED
Save the model
Close the table
Open the table again
Notice how the Storage option for the generated column shows VIRTUAL rather than STORED
[9 Aug 2021 3:28] Ignacio Zamora
(1) Errata: 

Instead of saying: "... that I didn't think at the time that was a problem with it." it should say "... that I didn't think at the time that THERE was a problem with it."
[9 Aug 2021 5:39] MySQL Verification Team
Hello Ignacio Zamora,

Thank you for the report and steps.
Verified as described.