Bug #96713 MySQL Workbench: UI issue after CREATE TABLE <tablename> LIKE <schema.tablename>
Submitted: 31 Aug 2019 18:46 Modified: 4 Oct 2019 14:44
Reporter: Cameron Landers Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.17 OS:Windows (Microsoft Windows 10 Pro)
Assigned to: CPU Architecture:x86 (x86/64)
Tags: WBBugReporter

[31 Aug 2019 18:46] Cameron Landers
Description:
This is a MysQL Workbench issue. I'm using 8.0.17.

Using a Connector/Node.js connection to my existing schema from a node REST service, I'm copying two existing tables using the following typical syntax:

CREATE TABLE <existing tablename> LIKE <schema.tablename>

After this command executes successfully, the two new tables appear in MySQL Workbench as expected. However, when I click on one of them in the Workbench UI, the table fields do not appear in the Information pane below, and a ghost copy of the table name appears below the original one in the tables list. 

If I click on the ghost copy in the tables list, the table column details appear in the Information pane. The only way to get the UI to appear normally without the duplicate table name is to close Workbench and reopen it. After doing so, the UI works correctly--it shows the tables correctly and clicking on them shows the details in the Information pane, and no more ghost items.

Important note: This occurs when I create two new tables, one after the other, and each table is created as a copy (using the LIKE syntax) from a separate, pre-existing source table in the schema. Both source tables are empty - they are just used as templates.

How to repeat:
Step 1. Start with Workbench open and a target schema with two or more existing tables selected,  with the tables node expanded, showing the existing tables.

Step 2. Using a Connector/Node.js connection to the existing schema via node.js based javascript code, create two new tables, one after the other--each new table created as a copy of an existing source table. 

This is a generic example of the SQL syntax I am using:

Example syntax for SQL CREATE statement for Table 1:
CREATE TABLE <table1copy> LIKE <schema>.<table1name>

Example syntax for SQL CREATE statement for Table 2:
CREATE TABLE <table2copy> LIKE <schema>.<table2name>

After the tables are created successfully, go back to MySQL Workbench, and refresh the tables list in the target schema. 

You should see the two new tables. When you click on one of them, Workbench will generate a "ghost" copy of it in the Tables list, and the behavior from there will be as described herein above (see the description). 

Interestingly, this only happens on one of the two new tables, and refreshing the tables list does not remove the ghost entry. The other table entry seems to exhibit normal behavior. If you then close MySQL Workbench and reopen it, The ghost table entry will be gone and you get normal behavior from there.

It seems to me like this might be due to some sort of caching going on behind the scenes of the Workbench UI, though that's just my theory, not having seen the Workbench source code.

Suggested fix:
Check into the source code for the Workbench UI and see if there might be some opportunity for unexpected caching behavior or other issue that might result in the described behavior.

Sorry, I don't have the source code or time to investigate it at that level, but I wanted to document this bug so maybe others can look into it at some point. It's not a huge priority but certainly a repeatable bug nonetheless.
[2 Sep 2019 8:57] Simon Vacker
I've had ghost tables show up too, and new tables missing in the list until a restart of Workbench, but it has been rare enough that I don't know the cause in my case.
[4 Sep 2019 14:44] MySQL Verification Team
Thank you for the bug report. Please provide a screenshot with ghost table and which server version are you connecting to?. Thanks.
[5 Oct 2019 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".