[MDEV-6405] More flexible SHOW CREATE TABLE Created: 2014-06-29 Updated: 2015-12-17 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Suppose I want to recover a table which does not exist anymore from an old physical backup. With MyISAM it's amazingly easy, but with InnoDB I need to re-create an empty table first, and maybe I don't know the table definition. So, would it be possible to make SHOW CREATE TABLE work even if "table doesn't exist in engine"? I hope that .frm contains sufficient information to do this. |
| Comments |
| Comment by Sergei Golubchik [ 2014-07-21 ] |
|
Yes, that's doable |
| Comment by Federico Razzoli [ 2015-12-17 ] |
|
This tool almost does what I'm asking for: https://www.percona.com/blog/2015/12/16/recovering-table-structure-from-frm-files-using-dbsake/ Note however the dangerous caveat: "It is important to mention that the command only decodes the information available in .frm file, which means that it cannot recover InnoDB foreign-key references and AUTO_INCREMENT values" |