Bug #92267 "GENERATED is not valid at this position" when reverse engineering stored column
Submitted: 2 Sep 2018 13:48 Modified: 4 Sep 2018 11:09
Reporter: Ronny H. Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:8.0.12, 8.0.27 OS:Windows (10)
Assigned to: CPU Architecture:Any (x64)
Tags: column, generated, reverse engineering, stored

[2 Sep 2018 13:48] Ronny H.
Description:
Reverse engineering fails with ERROR: (3, 17) "GENERATED" is not valid at this position, expecting: ')' in case of tables that have stored columns. Tested on MySQL Server 5.7.23.

How to repeat:
Create database and table:

CREATE DATABASE IF NOT EXISTS `test_db` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `test_db`;

CREATE TABLE `test_table` (
  `id` int(11) NOT NULL,
  `auto` int(11) GENERATED ALWAYS AS (1) STORED
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `test_table`
  ADD PRIMARY KEY (`id`);

Run "Reverse engineer" from "Database" menu. Select "test_db". "Import MySQL table objects". Execute. See log: ERROR: (3, 17) "GENERATED" is not valid at this position, expecting: ')'

Suggested fix:
Unknown.
[4 Sep 2018 11:09] MySQL Verification Team
Hello Ronny,

Thank you for the report.

thanks,
Umesh
[9 Apr 2019 20:20] Sergey Vinokursky
MySQL Workbench 8.0.15 When i modeling eer - i get same error :

ERROR: (3, 27) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (20, 27) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (51, 31) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (61, 24) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (72, 27) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (89, 27) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (97, 24) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (109, 29) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (117, 34) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (128, 27) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (140, 38) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (161, 32) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (182, 37) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (195, 26) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (206, 28) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (226, 30) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (242, 26) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (257, 29) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (271, 30) "GENERATED" is not valid at this position, expecting : ')'
ERROR: (282, 33) "GENERATED" is not valid at this position, expecting : ')'
[26 Feb 2020 23:09] John Slocum
Same thing happening to me, on a "generated always as (....) virtual" column.
[17 Jun 2022 5:27] John King
1. create relation
CREATE TABLE `reverse`.`generated` (
  `ID` INT UNSIGNED NOT NULL,
  `firstname` VARCHAR(45) NULL,
  `lastname` VARCHAR(45) NULL,
  `fullname` VARCHAR(45) GENERATED ALWAYS AS (concat_ws("  ",firstname, lastname)) VIRTUAL,
  PRIMARY KEY (`ID`));

2. reverse engineer

ERROR: (3, 25) "GENERATED" is not valid at this position, expecting ')'
[17 Jun 2022 6:16] MySQL Verification Team
Bug #107582 marked as duplicate of this one.