← Back to team overview

maria-developers team mailing list archive

mysql_upgrade issue for libmysqld and amarok

 

This is a follow up on a discussion I had with eean on Freenode IRC #maria.

The issue is how to upgrade libmysqd from MySQL version 5.1 to version 5.5 (or
more generally any major version upgrade), in particular as relates to
Amarok's use of libmysqld.

The procedure for upgrading a normal MySQL server is to run the mysql_upgrade
command. However, this requires a running mysqld server, so it is not
appropriate for libmysqld, or at least very inconvenient.

We discussed this briefly at our MariaDB meeting in Lisbon, and here is what
we came up with:

One idea is to also build mysql_upgrade_embedded; this would be a variant of
mysql_upgrade linked with libmysqld, so it does not depend on the mysqld
server. Similarly, we would need mysqlcheck_embedded (mysqlcheck is called
from mysql_upgrade). These two binaries could be included in the libmysqld
package (they are small).

The upgrade procedure for amarok would then be to stop amarok linked with 5.1,
then run mysql_upgrade_embedded (from 5.5) against the amarok libmysqld data
directory, then start amarok linked with 5.5.

Does that sound useful?

The other idea that came up was to add this as extra calls in the library. So
that the amarok application could just call some mysql_upgrade() function
instead of having to run an external upgrade binary. Would this be more useful
for amarok?

Either way, we then need to think on how to implement this change.

We could offer to implement this (either solution I think) in MariaDB (a
version of MariaDB that includes MySQL 5.5 is in the works). This would allow
to use the above to upgrade Amarok to using MariaDB 5.5. Would this work?

(I think it would even work to keep Amarok using MySQL 5.5 libmysqld, but
using MariaDB 5.5 mysql_upgrade_embedded, though that is kind of a strange
solution. Or we could provide the patch for MariaDB and you could patch
libmysqld similarly to provide the same functionality in relevant distros.)

Does this sound like a feasible way forward?

One question about how Amarok uses libmysqld, which will help understand what
is needed to solve the upgrade issue:

Does Amarok use libmysqld built with the --with-embedded-privilege-control
option, or use stored procedures, or other things that require the `mysql'
database schema to be available in MySQL?

If this does not make sense, the answer is probably "no" :-)

The background: When a normal standalone mysql database server is installed,
it is necessary to create the `mysql' database schema using
mysql_create_db. This database schema contains such things as user accounts
and passwords, stored procedure code, etc.

Normally, libmysqld does not do any access control on accounts, and it is
possible to use it without running mysql_install_db. In fact it's a bit hard
to run mysql_install_db, as it has the same issue as mysql_upgrade. So I
assume that Amarok does not do this and just does not use account privileges
or stored procedures/functions, but just wanted to check?

This affects how much mysql_upgrade_embedded has to do, as part of the upgrade
is to add any missing columns in tables in the `mysql' database schema.

 - Kristian.