Chuck,
Sorry for telling this only now, but I think that table locking during restore
should be done before the drivers are initialized (before the begin() call).
Thus I'd move the code collecting table list and locking tables to the beginning:
> bool restore_table_data(THD*, Restore_info &info, IStream &s)
> {
> DBUG_ENTER("restore::restore_table_data");
>
> enum { READING, SENDING, DONE, ERROR } state= READING;
>
> // FIXME: when selective restores are implemented, check that
> // nothing was *selected* to be restored.
>
> if (info.img_count==0 || info.table_count==0) // nothing to restore
> DBUG_RETURN(TRUE);
>
> result_t res;
> Restore_driver* drv[256];
>
> DBUG_ASSERT(info.img_count < 256);
>
Here is a good place to collect table lists from default and CS drivers and lock
them. This would required a separate loop to search for the two drivers but this
is OK. Alternatively, the Restore_info class could be modified to store
positions of these two images in the image list (filling them correctly when the
info is read from a stream).
> for (uint no=0; no < info.img_count; ++no)
> {
> drv[no]= NULL;
Again, this is not a crucial change - the code should work as it is now. But
eventually (perhaps post-alpha) I'd like to do it "the right way".
Otherwise the patch is fine.
Rafal