fastmonkeys / stellar

Fast database snapshot and restore tool for development
MIT License
3.86k stars 119 forks source link

mysql restore losing original default collation #49

Open stronk7 opened 9 years ago

stronk7 commented 9 years ago

mysql has many default charsets and collations. at server level, at database level, at table level and at column level.

And all those defaults are used as fallback topdown.

While it seems that both table and column varchar and collation are preserved ok by stellar snapshot & restore... the database defaults are not, and that leads to the restored database having a (fallback) default inherited from server level, instead of the defaults it may have explicitly defined.

And that has consequences about every table and column that are later created in the restored database. Instead of using the original database charset and collation, everything is created with the "new" defaults (inherited from server).

So stellar needs to store the database default charset and collations (if defined) in order to proceed, on restore, to the creation of a database with exactly the same default charset and collation.

Workaround: Make your default server charset and collation to match the default expected in restored databases, but that's not flexible enough.

Ciao :-)

Teemu commented 9 years ago

The MySQL support definitely has lots of quirks.