Hi Chuck,
Status: Not approved. I suspect a problem.
Required:
2) Please check, if all partition's subpartition's engines types are
checked.
Options:
1) Add an assert.
Details:
Chuck Bell, 06.11.2009 17:10:
...
> 2888 Chuck Bell 2009-11-06
> BUG#47879 : Backup of partitioned tables with subpartitions can crash server
>
> Tables with subpartitions cause backup to crash the server.
>
> The reason is the code is not designed to detect subpartitions
> and tries to access a member of a struct that does not exist.
>
> This patch detects when subpartions exist and reassign the
> pointers in the loop to traverse the subpartitions list
> instead when subpartitions are detected.
...
> === modified file 'sql/backup/backup_info.cc'
> --- a/sql/backup/backup_info.cc 2009-10-23 15:41:56 +0000
> +++ b/sql/backup/backup_info.cc 2009-11-06 16:10:48 +0000
> @@ -68,6 +68,16 @@ storage_engine_ref get_storage_engine(TH
>
> while ((p_el= p_it++))
> {
> + /*
> + If this partition has subpartitions, we must traverse the subpartitions
> + list instead of the partitions list.
> + */
> + List_iterator<partition_element> p_sub_it(p_el->subpartitions);
> + if (!p_el->engine_type)
> + {
> + p_el= p_sub_it++;
> + p_it= p_sub_it;
> + }
1) Can we rely on a non-Null engine type in all subpartitions? Probably
yes. But then I'd still add an assert, just to be safe.
2) A different question is: How do we come back to the main partition
list? If I understand the function correctly, it checks, if all
partitions have the same engine type. With the new code, won't we just
check the subpartitions of the first partition? If that subpartition
list is at its end, won't the 'while' loop just end?
...
Regards
Ingo
--
Ingo Strüwing, Database Group
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring HRB München 161028