List:Commits« Previous MessageNext Message »
From:Ingo Strüwing Date:February 25 2009 1:06pm
Subject:Re: bzr commit into mysql-6.0 branch (ingo.struewing:2781) Bug#41578
View as plain text  
Hi Rafal,

Rafal Somla, 25.02.2009 10:05:

...
> 1. In si_objects, set sql_mode to NO_AUTO_CREATE_USER so that users are
> not implicitly created when restoring privileges.


Done.

>    Add necessary checks
> in tests to verify that it is not the case (I think
> backup_db_grants_extra test contains a scenario where grantees are
> dropped before restore).


I don't know, how to do that. Adding the sql_mode didn't change
anything. I checked backup_db_grants_extra and wasn't sure if any of the
tests should address the problem. So I added an explicit test to the new
backup_table_grants. I got:

RESTORE FROM 'mysqltest1.bak';
backup_id
#
Warnings:
#	1739	The grant 'INSERT ON mysqltest1.t2' for the user 'mysqluser2'@'%'
was skipped because the user does not exist.
#	1739	The grant 'SELECT(col1) ON mysqltest1.t1' for the user
'mysqluser2'@'%' was skipped because the user does not exist.
#	1739	The grant 'UPDATE(col2) ON mysqltest1.t1' for the user
'mysqluser2'@'%' was skipped because the user does not exist.

It seems that this problem is addressed in bcat_create_item() already.
So I don't know how to come through to si_objects with an attempt to
grant anything to a non-existent user.

Of course it is still more safe to set the sql_mode anyway.

> 
> 2. Answer question [1] below.


Done. See below.

...
>> +    else if ((thd->backup_in_progress != SQLCOM_RESTORE))
>>      {
>>        if (!(rights & CREATE_ACL))
>>        {
>>
> 
> [1] This means that the check for table_list->grant.want_privilege (few
> lines below) will be skipped during RESTORE. Is it correct to skip this
> check?

For the tests it doesn't make a difference. But I agree that it looks
safer to not skip this. However, I don't have any idea, how we could
come here with unmet privileges. So I don't have a test for it.

New patch: http://lists.mysql.com/commits/67536

Regards
Ingo
-- 
Ingo Strüwing, Database Group
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Dr. Roland Bömer
Vorsitzender des Aufsichtsrates: Martin Häring   HRB München 161028
Thread
bzr commit into mysql-6.0 branch (ingo.struewing:2781) Bug#41578Ingo Struewing24 Feb
  • Re: bzr commit into mysql-6.0 branch (ingo.struewing:2781) Bug#41578Rafal Somla25 Feb
    • Re: bzr commit into mysql-6.0 branch (ingo.struewing:2781) Bug#41578Ingo Strüwing25 Feb