Bug #55241 Drop Table doesn't remove table MySQL Workbench Dictionary
Submitted: 14 Jul 2010 2:06 Modified: 14 Jul 2010 4:16
Reporter: David Dykstra Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S1 (Critical)
Version:5.2.25 OS:Mac OS X (10.6.4)
Assigned to: CPU Architecture:Any
Tags: drop table, MySQL, sql editor

[14 Jul 2010 2:06] David Dykstra
Description:
When a table is dropped using MySQL Workbench, SQL Editor, it is successfully dropped from the database but MySQL Workbench will not allow you to create a new table with that same name in that database. 
I was able to work around it by closing MySQL workbench resetting the connection to the database and restarting SQL Editor.
Take note I you InnoDB as my database type.

How to repeat:
1. Connect to a local database using 127.0.0.1
2. Remove a created table from the database. (InnoDB)
3. Try to CREATE TABLE `tbl_sameNameAsTableThatWasDeleted`
It will produce an error saying the table already exists. If you try to delete that table manually it will say the table does not exist.

Suggested fix:
Remove all internal references to that table. The problem may be in the Internal Database Dictionary storing data to rollback changes made.
[14 Jul 2010 2:34] David Dykstra
This error also occurs when deleting the table manually outside of MySQL Workbench. If you use any other source to remove a table from the database, the frm won't exist, at the same time the Dictionary in MySQL Workbench thinks it still exists.
Possible solution, reload database, from the MySQL Database directly and refresh any caching that may be going on internaly
[14 Jul 2010 2:45] David Dykstra
My Work around is
1. Deleting your connections to the database, both administrator and editor. 
2. Close MySQL Workbench
3. Restart the MySQL Server
4. Start MySQL Workbench and reconnect to the database.
All possible caches are then purged and the connection is forced to grab all new information from the MySQL Server, fixing any hidden references to tables that do not exist.
[14 Jul 2010 3:59] Valeriy Kravchuk
The only proper way to remove InnoDB table from the database is DROP TABLE execution. If you remove some file(s) (.frm?) from disk manually you definitely get a data dictionary corruption that server should report in its error log. Please, check.

In any case this is NOT a bug in Workbench.
[14 Jul 2010 4:12] David Dykstra
Actually, I am talking about right clicking on the table in the SQL Editor and choosing drop table. I have not touched the files manually. This problem occurs every time I remove tables the way I am supposed to.

Of course removing table files manually would cause errors. The FRM's should not be touched, that's why the file permissions in Mac won't let you remove those files unless you are root.
[27 May 2014 3:54] Valeriy Kravchuk
This report had to be set back to "Open" long time ago...
[28 May 2014 9:39] Umesh Shastry
This issue is not repeatable on latest Workbench version 6.1.6