Bug #92499 cannot reverse engineer a schema
Submitted: 19 Sep 2018 12:07 Modified: 23 Nov 2018 13:23
Reporter: Mark Chapple Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:8.0.12 OS:Windows (Microsoft Windows 10 Home)
Assigned to: CPU Architecture:Any
Tags: model, reverse engineering, WBBugReporter

[19 Sep 2018 12:07] Mark Chapple
Description:
When attempting to reverse engineer from populated tables in a schema, the process is successful until the "Reverse Engineer" step, where an error message appears with the following log:

ERROR: (0, 16) "ProductData" is not valid at this position for this server version, expecting an identifier
ERROR: (3, 13) "Product" is not valid at this position for this server version, expecting an identifier
ERROR: (27, 13) "ProductPrice" is not valid at this position for this server version, expecting an identifier
ERROR: (35, 13) "Simple" is not valid at this position for this server version, expecting an identifier
ERROR: (62, 13) "StockCost" is not valid at this position for this server version, expecting an identifier
ERROR: (85, 13) "StockItem" is not valid at this position for this server version, expecting an identifier
ERROR: (139, 35) "root" is not valid at this position for this server version, expecting an identifier
ERROR: (139, 72) "ProductData" is not valid at this position for this server version, expecting a new view name
ERROR: (139, 108) "ProductData" is not valid at this position for this server version, expecting an identifier
ERROR: (139, 121) "." is not valid at this position, expecting: EOF, ';'

How to repeat:
Select <Database>, <Reverse Engineer> and then clicking the default <next> / <execute> buttons.
[19 Sep 2018 12:42] MySQL Verification Team
Thank you for the bug report. Please provide the model file (use Files and private if you wish) also which server version are you using?. Thanks.
[19 Sep 2018 13:27] MySQL Verification Team
Thank you for the feedback. Oh sorry, then please provide a dump file of the schema to test the reverse engineering. Thanks.
[25 Sep 2018 12:41] MySQL Verification Team
Reverser engineer ends

Attachment: 92499.png (image/png, text), 172.18 KiB.

[25 Sep 2018 12:42] MySQL Verification Team
Thank you for the feedback. I couldn't repeat please see prior attached screenshot.
[26 Sep 2018 7:37] Mark Chapple
I see that you cannot replicate the issue from the dump file. I suspect that this may have more to do with my set-up than the data tables themselves (since I can use these to query, import / export etc.). The log suggests some sort of mismatch between software / mysql versions? Perhaps 32 vs 64 bit as well?

Incidentally, I have been able to replicate this issue on another PC, with "fresh" installation of Workbench etc. I have also tried to forward engineer a new schema and failed.

In order to progress this, would you need to gain access to my instance or even my PC or can you recommend another course of action?
[4 Oct 2018 20:00] sam brownlow
I can confirm this bug.  Running Workbench 8.0 Community.

The reverse engineer works except for 2 of the tables.

It is failing on both tables due to the parsing of CREATE TABLE, specifically because the 2 failure tables contain table-level comment containing an apostrophe ( ' ), i.e. "COMMENT = 'Oracle says, \'Hello\''"

The specific error is:

ERROR: (59, 80) 'Hello' is not valid at this position, expecting: EOF, ';'

Some of the other tables, which successfully reverse engineer, contain comments, but none of the comments contain apostrophe.
[4 Oct 2018 21:32] MySQL Verification Team
@[4 Oct 20:00] sam brownlow
Your case: 
"It is failing on both tables due to the parsing of CREATE TABLE, specifically because the 2 failure tables contain table-level comment containing an apostrophe ( ' ), i.e. "COMMENT = 'Oracle says, \'Hello\''"

Then in this case is duplicate of: https://bugs.mysql.com/bug.php?id=92191
[5 Oct 2018 11:00] Mark Chapple
I see that this bug has been classed as having been caused by table-level comments with apostrophe.

However, none of my tables has any comments.
[23 Oct 2018 13:23] MySQL Verification Team
Please try version 8.0.13. Thanks.
[24 Nov 2018 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".
[20 Feb 2019 23:10] MySQL Verification Team
@Dave Eccles,
Thank you for the feedback, using your test case I have not issue with reverse engineer with 8.0.15 WorkBench and 8.0.15 server running on Windows 10 Pro. I will attach a screenshot with the model created.
[20 Feb 2019 23:14] MySQL Verification Team
Showing the Model

Attachment: 92499_1.png (image/png, text), 167.50 KiB.

[28 Jun 2019 16:00] Dario Colin
I am just starting to learn databases and MySQL, and I am seeing this same error when trying to reverse engineering the samples that come with MySQL installation. 

ERROR: (0, 16) "sakila" is not valid at this position for this server version, expecting  an identifier
ERROR: (3, 13) "actor" is not valid at this position for this server version, expecting  an identifier
ERROR: (13, 13) "address" is not valid at this position for this server version, expecting  an identifier
ERROR: (30, 13) "category" is not valid at this position for this server version, expecting  an identifier
ERROR: (38, 13) "city" is not valid at this position for this server version, expecting  an identifier
ERROR: (49, 13) "country" is not valid at this position for this server version, expecting  an identifier
ERROR: (57, 13) "customer" is not valid at this position for this server version, expecting  an identifier
ERROR: (76, 13) "film" is not valid at this position for this server version, expecting  an identifier
ERROR: (99, 13) "film_actor" is not valid at this position for this server version, expecting  an identifier
ERROR: (110, 13) "film_category" is not valid at this position for this server version, expecting  an identifier
ERROR: (121, 13) "film_text" is not valid at this position for this server version, expecting  an identifier
ERROR: (130, 13) "inventory" is not valid at this position for this server version, expecting  an identifier
ERROR: (143, 13) "language" is not valid at this position for this server version, expecting  an identifier
ERROR: (151, 13) "payment" is not valid at this position for this server version, expecting  an identifier
ERROR: (169, 13) "rental" is not valid at this position for this server version, expecting  an identifier
ERROR: (188, 13) "staff" is not valid at this position for this server version, expecting  an identifier
ERROR: (208, 13) "store" is not valid at this position for this server version, expecting  an identifier
ERROR: (221, 12) "sakila" is not valid at this position for this server version, expecting  a new view name
ERROR: (221, 44) "a" is not valid at this position for this server version, expecting  an identifier
ERROR: (221, 47) "." is not valid at this position, expecting : EOF, ';'
ERROR: (224, 12) "sakila" is not valid at this position for this server version, expecting  a new view name
ERROR: (224, 47) "cu" is not valid at this position for this server version, expecting  an identifier
ERROR: (224, 51) "." is not valid at this position, expecting : EOF, ';'
ERROR: (227, 12) "sakila" is not valid at this position for this server version, expecting  a new view name
ERROR: (227, 43) "sakila" is not valid at this position for this server version, expecting  an identifier
ERROR: (227, 51) "." is not valid at this position, expecting : EOF, ';'
ERROR: (230, 12) "sakila" is not valid at this position for this server version, expecting  a new view name
ERROR: (230, 60) "sakila" is not valid at this position for this server version, expecting  an identifier
ERROR: (230, 68) "." is not valid at this position, expecting : EOF, ';'
ERROR: (233, 12) "sakila" is not valid at this position for this server version, expecting  a new view name
ERROR: (233, 56) "c" is not valid at this position for this server version, expecting  an identifier
ERROR: (233, 59) "." is not valid at this position, expecting : EOF, ';'
ERROR: (236, 12) "sakila" is not valid at this position for this server version, expecting  a new view name
ERROR: (236, 55) "c" is not valid at this position for this server version, expecting  an identifier
ERROR: (236, 58) "." is not valid at this position, expecting a complete function call or other expression
ERROR: (236, 78) "cy" is not valid at this position for this server version, expecting  an identifier
ERROR: (236, 82) "." is not valid at this position, expecting : EOF, ';'
ERROR: (239, 12) "sakila" is not valid at this position for this server version, expecting  a new view name
ERROR: (239, 44) "s" is not valid at this position for this server version, expecting  an identifier
ERROR: (239, 47) "." is not valid at this position, expecting : EOF, ';'

I am working with MySQL workbench 8.0.16 build 14498383 CE (64 bits). Could any one could help me to figure it out what the issue is? 

Thanks,