Rafal,
I have moved the Tables definition per your request but it does not compile.
The command (*snap_table_list)[i] returns a type table_ref which is not
compatible what I need to do. It needs to be converted to a pointer of type
obs::Obj in order to build a TABLE_LIST. I need access to the tables member,
not the table_ref member.
The only way I found around this was to do the materialization myself. But
that means repeating operations that have already been done and therefore
wasting cycles. This is the code without Tables exposed. It's messy.
Exposing Tables is much easier, cleaner, and avoids duplication of work. I
will leave it as I had it in my original patch.
/*
Collect tables from all drivers for name locking.
*/
Table_list *snap_table_list= snap->get_table_list();
for (uint i= 0; i < snap_table_list->count(); i++)
{
String s;
Table_ref t= (*snap_table_list)[i];
obs::Obj *tbl= obs::materialize_table(&t.db().name(), &t.name(), 0,
&s);
tables_to_lock.push_front(tbl);
}
If you disagree with this decision, I invite you to suggest alternatives
because I just don't see how a table_ref can become an obs::Obj any other
way.
If leaving the patch as-is is OK with you then please check the boxes for
BUG#36749, BUG#36778, BUG#36782.
Chuck
> Thanks for taking into account my comments so far. I still
> have one final remark. You made the internal type
> Image_info::Tables public (probably I used this type in my
> earlier suggestions). But actually doing this is not necessary.
> Class Image_info::Tables implements public interface
> backup::Table_list and it is enough to use the public
> interface (see below).
>
> After fixing this the patch is good to push.
| Thread |
|---|
| • bzr commit into mysql-6.0-backup-myisam branch (cbell:2618) Bug#36749,Bug#36778, Bug#36782 | Chuck Bell | 20 Jun |
| • Re: bzr commit into mysql-6.0-backup-myisam branch (cbell:2618) Bug#36749,Bug#36778, Bug#36782 | Rafal Somla | 23 Jun |
| • RE: bzr commit into mysql-6.0-backup-myisam branch (cbell:2618) Bug#36749, Bug#36778, Bug#36782 | Chuck Bell | 23 Jun |
| • RE: bzr commit into mysql-6.0-backup-myisam branch (cbell:2618) Bug#36749, Bug#36778, Bug#36782 | Chuck Bell | 23 Jun |
| • Re: bzr commit into mysql-6.0-backup-myisam branch (cbell:2618) Bug#36749,Bug#36778, Bug#36782 | Rafal Somla | 24 Jun |
| • Re: bzr commit into mysql-6.0-backup-myisam branch (cbell:2618)Bug#36749, Bug#36778, Bug#36782 | Jørgen Løland | 23 Jun |