WL#2550: Parallelise ALTER TABLE

Affects: Server-6.x   —   Status: Assigned

One step in the direction of Parallel Query is to handle parallelisation of
ALTER TABLE.
The phase of ALTER TABLE to parallelise is the copy phase.
The idea is to parallelise this for tables that are partitioned.

If the original table is not partitioned then no parallelisation of the
read part will be performed, the insert part will however be parallelised
if the new table is partitioned.

The idea is to have one thread per partition in the original table
and one thread per partition in the new table.

Thus we can achieve a very good optimisation.

One important base feature needed for this development is the ability to
transport data between threads in the MySQL Server.

It should even be checked whether it is possible to allow several MySQL Servers
to partiticipate in the copy process for clustered tables.

The changes are local to the copy_data_between_tables method and thus affect
a very limited part of the MySQL Server.