Bug #105401 MySQL Workbench Can't display DDL for tables with Invisible Columns
Submitted: 1 Nov 2021 16:28 Modified: 17 Jun 10:40
Reporter: IGG t Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:8.0.27 OS:Any
Assigned to: CPU Architecture:Any
Tags: invisible, workbench

[1 Nov 2021 16:28] IGG t
Description:
MySQL Workbench Can't display DDL for tables with Invisible Columns when doing right click > Alter Table

How to repeat:
create a simple table:

CREATE TABLE `test`.`t1` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `d1` VARCHAR(45) NULL,
  PRIMARY KEY (`id`));

Now in workbench do right click > alter table on that table. The relevant page opens.
Now do:

ALTER TABLE `test`.`t1` MODIFY `id` INT UNSIGNED NOT NULL AUTO_INCREMENT INVISIBLE;

Now do right click > Alter Table. and you get an error message:

Error Parsing DDL for `test`.`t1`
There was an error while parsing the DDL retrieved from the server.

Remove the Invisible Column and it works fine again.

Suggested fix:
Make workbench aware of invisible columns and how to handle them.
[23 Nov 2021 13:01] MySQL Verification Team
Hello,

Thank you for the bug report.
As per the documentation, the primary key cannot be made invisible. For more info please see https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html

Regards,
Ashwini Patil
[23 Nov 2021 13:59] IGG t
There is some confusion. You are talking about Invisible "INDEXES", My problem is with Invisible "COLUMNS". 

And as per my example, MySQL is quite happy to create a table with an Invisible Column that is also used as a Primary Key (so long as the primary key itself isn't invisble).
[25 Nov 2021 13:14] MySQL Verification Team
Hello,

Thank you for the feedback.
Verified as described.

Regards,
Ashwini Patil
[17 Jun 10:40] IGG t
This still seems to be a problem for MySQL 8.0.37 and Workbench 8.0.36