Bug #71819 Unable to drop orphaned table temporary table
Submitted: 24 Feb 2014 15:39 Modified: 2 May 2014 8:24
Reporter: Steven Hartland Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.6.14 OS:Any
Assigned to: CPU Architecture:Any

[24 Feb 2014 15:39] Steven Hartland
Description:
When trying to recover from a missing tablespace file as described in:
http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html

The process fails with "[Err] 1051 - Unknown table 'mpuk.#sql-ib7449'".

The initial issue was reported on start after restoring a hot copy from the mysql master via a zfs send.

2014-02-24 13:53:36 24373 [ERROR] InnoDB: Table mpuk/#sql-ib7449 in the InnoDB data dictionary has tablespace id 7958, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html
InnoDB: for how to resolve the issue.

I believe the issue is that the table name passed by the client is being escaped hence its not correct when the server processes it e.g. on create you get @@0023sql@002dib7449 on the filesystem instead of #sql-dib7449

How to repeat:
Try to drop a orphaned temporary innodb table
[1 Apr 2014 17:21] MySQL Verification Team
Please check: http://bugs.mysql.com/bug.php?id=72135. Thanks.
[2 May 2014 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".
[2 May 2014 8:24] Steven Hartland
We haven't tested as we needed to get the db back online so where forced to reinstall from a backup, however the workaround in linked bug should work hence closing.