| List: | Internals | « Previous MessageNext Message » | |
| From: | Dmitry Lenev | Date: | March 29 2011 11:46am |
| Subject: | Re: storage engine access to serialized version of a TABLE or TABLE_SHARE? | ||
| View as plain text | |||
Hello, Zardosht, Sergei! * Sergei Golubchik <serg@stripped> [11/03/29 10:57]: > Hi, Zardosht! > > On Mar 28, Zardosht Kasheff wrote: > > Hello all, > > > > Is there a way for the storage engine to get some sort of byte stream > > that represents a serialized version of a TABLE or TABLE_SHARE object? > > The goal is to save it locally during handler::create and then check > > its contents (as a sanity check) with the TABLE_SHARE passed in during > > handler::open. > > > > Is this possible? And if it is, is there a way to take this serialized > > data and print what the table looks like in user readable form? > > I'm afraid not. > > You can take the generated create table statement, like Stewart > suggested, or grab the complete frm file, like NDB does. But I think it > may be possible to construct an ALTER TABLE statement that modifies the > table definition (frm) only, and your sanity check will fail on the next > open. I think the latter approach should work (after all it works for NDB). In cases when ALTER TABLE statement modifies only table definition (i.e. only .FRM), we still call handler::ha_create_handler_files() method after new version of .FRM is installed, in order to inform storage engine about the fact that .FRM has been changed. -- Dmitry Lenev, Software Developer Oracle Development SPB/MySQL, www.mysql.com Are you MySQL certified? http://www.mysql.com/certification
