Marc Alff a écrit, Le 05.03.2010 21:34:
> Hi Guilhem
> Thanks for the quick review.
> Guilhem Bichot wrote:
>> Hello Marc,
>> Marc Alff a écrit, Le 05.03.2010 16:31:
>>> #At file:///home/malff/BZR_TREE/mysql-next-mr-bugfixing-45194/ based
>>> on revid:alik@stripped
>>> 3122 Marc Alff 2010-03-05
>>> Bug#45194 mysql_upgrade deletes existing data in
>>> performance_schema database/schema
>>> Before this fix, mysql_upgrade would always drop and re
>>> the performance_schema database.
>>> This in theory could destroy user data created using 5.1 or
>>> older versions.
>>> With this fix, mysql_upgrade checks the content of the
>>> performance_schema database before droping it.
>>> === added file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
>>> --- a/mysql-test/suite/perfschema/r/pfs_upgrade.result 1970-01-01
>>> 00:00:00 +0000
>>> +++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result 2010-03-05
>>> 15:31:01 +0000
>>> @@ -0,0 +1,153 @@
>>> +drop table if exists test.user_table;
>>> +drop procedure if exists test.user_proc;
>>> +drop function if exists test.user_func;
>>> +drop event if exists test.user_event;
>>> +"Testing mysql_upgrade with TABLE performance_schema.user_table"
>>> +create table test.user_table(a int);
>>> +use performance_schema;
>>> +show tables like "user_table";
>>> +Tables_in_performance_schema (user_table)
>>> +ERROR 1644 (HY000) at line 178: Unexpected content found in the
>>> performance_schema database.
>>> +ERROR 1050 (42S01) at line 203: Table 'COND_INSTANCES' already exists
>> So even if we detect the presence of unexpected content, we still try to
>> create COND_INSTANCES, and in the end we report a failed upgrade.
>> What is the gain of creating COND_INSTANCES in this case...?
> None, but at least this does not destroy user data, so this is safe.
> I don't want to make the script more complicated that it already is, to
> account for "more cosmetic" error reporting.
Ok... As the existence of a performance_schema database is already
unlikely, and as creating COND_INSTANCES into it is not going to ruin
something seriously, I won't nit-pick more. Ok to push.