On Tue, 29 Mar 2011 08:53:03 +0200, Sergei Golubchik <serg@stripped> wrote:
> 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.
ARCHIVE also grabs the FRM, engine code is a bit simpler.
Grabbing the FRM is how you implement discovery too, so that's why you
can just pass around the ARZ file (as well as what NDB stores as a BLOB
in its data dictionary).
> MySQL does not provide a way to serialize a table definition in a form
> that doesn't change by these ALTER's and change by all others. Unless
> the engine implements it internally :(
We do have this in Drizzle with the table protobuf message (the protobuf
library rather nicely even has a serialize-to-human-readable-string
part, which is extra nice in debugging).
--
Stewart Smith