List:Commits« Previous MessageNext Message »
From:Luís Soares Date:February 9 2011 3:34pm
Subject:Re: bzr commit into mysql-trunk branch (luis.soares:3595) Bug#59708
View as plain text  
Hi Li-Bing,

   Thanks for the prompt review.

On 02/09/2011 02:04 PM, anders wrote:
> Hi Luis,
> Nice work, I am OK with the patch.
> I have a suggestion on the code.
>
> [snip]
>>
>>
>> -  if (passwd&&  user->password.str)
>> +  if (ident&&  user->plugin.str&& 
> (user->plugin.length>  0))
>> +  {
>> +    str->append(STRING_WITH_LEN(" IDENTIFIED WITH "));
>> +    str->append(user->plugin.str, user->plugin.length);
>> +
>> +    if (user->auth.str&&  (user->auth.length>  0))
>> +    {
>> +      str->append(STRING_WITH_LEN(" AS '"));
>> +      str->append(user->auth.str, user->auth.length);
>> +      str->append('\'');
>> +    }
>> +  }
>> +  else if (ident&&  user->password.str)
>>     {
>>       str->append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD '"));
>>       str->append(user->password.str, user->password.length);
>>
> I think it is better to make above code into one block.
> eg.
> if (ident)
> {
>    if (user->plugin.str ...)
>    {
>      ...
>    }
>    else if (user->password.str)
>    {
>       ...
>    }
> }
>

Duh! :)

Thank you!

Regards,
Luís
Thread
bzr commit into mysql-trunk branch (luis.soares:3595) Bug#59708Luis Soares8 Feb
Re: bzr commit into mysql-trunk branch (luis.soares:3595) Bug#59708Luís Soares9 Feb