The intention from the start was to make upgrades to newer MySQL versions trivial. We have done a lot of work to keep data formats compatible (both in the .frm files and in the storage engines); when you install a new version of MySQL things should “just work”.

For a long time this was true, until MySQL 5.0 where we had to do some data incompatible changes, like in the way some characters were sorted and how end-of-line blanks were stored in indexes.

To make the upgrade process easy, we created the ‘mysql_upgrade’ program which should detect possible incompatible tables and automatically convert data as needed.

The full upgrade process (for your data) should always be as simple as:

  1. Install your new MariaDB / MySQL version.
  2. Start the mysqld server.
  3. Run mysql_upgrade.

Unfortunately, over time something has gone wrong. We found this out when a user recently tried to upgrade a big installation from MySQL 5.0 to MariaDB. The issues encountered included:

  • Tables with long names were not converted to the new 5.1 name format
  • Some InnoDB tables failed with the error: “Table upgrade required; Please do “REPAIR TABLE `xxx`” or dump/reload to fix it!”
  • The same failure for all ARCHIVE tables
  • Some strange error messages for some internal system tables

So the upgrade process for this user was actually:

  1. Install the new MariaDB / MySQL version.
  2. Start the mysqld server
  3. Run mysql_upgrade
  4. Make a list of all tables that failed to upgrade.
  5. Reinstall the previous MySQL version.
  6. Dump the problem tables with mysql_dump
  7. Remove the dumped tables.
  8. Install the new MariaDB / MySQL version again.
  9. Load the dumped tables.
  10. Test that nothing was missed with ‘mysql_upgrade –force’

We learned about the above problems on the #maria IRC channel and within 24 hours we had fixed all of the issues. We are happy to announce the full upgrade process is once again just the three step: Install new version, Start mysqld, Run ‘mysql_upgrade’.

We also added more options to mysql_upgrade and mysqlcheck (which is used by mysql_upgrade) to make it easier to find out what is happening if something does go wrong.

As part of the process (and to document the changes) we also added some new articles to our Knowledgebase about
upgrading from MySQL 5.0, mysql_upgrade and mysqlcheck.

We hope all the above will make the upgrade process much easier and more reliable for everyone!

I’ve just pushed the last batch of changes into 5.2 tree. The most important change was renaming Maria engine to Aria (with old maria* compatibility variables). Other — smaller — changes included adding all plugins to the windows .zip distribution (sphinx and oqgraph too), building mysqld.exe with federatedx, not old federated engine, refactoring of mysql-test-run suite to support pluggable per-suite extensions, print the plugin configuration in the ./configure script, and other even smaller changes. Together with all bug fixes that 5.2 has accumulated over time it made the tree ready for the next release – 5.2.2!

If you want to know more about MySQL and MariaDB plugins read below. Our (Andrew Hutchings and mine) book MySQL 5.1 Plugins Development was just published by Packt. As far as I know it’s the first and the only book completely dedicated to MySQL Plugin API. It covers all existing in 5.1 plugin types, from Daemon to Storage Engines, and does not shun from explaining less known or poorly understood features of the plugin API. It describes newer plugin API extensions too – such as authentication plugins and recent CREATE TABLE extension. Also there is one chapter dedicated to UDFs.

This a “learning by example” style book, very different from the reference manual style. It is written around 23 fully working and thoroughly explained plugins example – simple demos as well as practically useful ones. My personal favorites are

  • getrusage daemon plugin
  • condition pushdown I_S plugin
  • exif full-text parser
  • Tocab storage engine (with b-tree indexes!)
  • USB authentication plugin

See the complete list in the table of contents.

What others think: