List:Commits« Previous MessageNext Message »
From:Tatjana Azundris Nurnberg Date:December 6 2007 10:28am
Subject:Re: bk commit into 4.1 tree (tnurnberg:1.2686) BUG#31752
View as plain text  
Georgi Kodinov <gkodinov@stripped> writes:

>> diff -Nrup a/sql/log.cc b/sql/log.cc
>> --- a/sql/log.cc	2006-12-05 10:45:17 +01:00
>> +++ b/sql/log.cc	2007-11-26 07:48:28 +01:00
>> @@ -966,7 +966,7 @@ void MYSQL_LOG::make_log_name(char* buf,
>>   if (dir_len > FN_REFLEN)
>>     dir_len=FN_REFLEN-1;
>
> Since now you're doing -1 on the strmake imho this -1 should go.
>
>>   strnmov(buf, log_file_name, dir_len);
>> -  strmake(buf+dir_len, log_ident, FN_REFLEN - dir_len);
>> +  strmake(buf+dir_len, log_ident, FN_REFLEN - dir_len -1);
>> }

  I agree that this is suboptimal, but I propose that it is
  for the opposite of what you suggested:  : )

  uint dir_len = dirname_length(log_file_name); 
  if (dir_len > FN_REFLEN)
    dir_len=FN_REFLEN-1;
  strnmov(buf, log_file_name, dir_len);
  strmake(buf+dir_len, log_ident, FN_REFLEN - dir_len -1);

  If dir_len == FN_REFLEN, the if() is false, and we'll call
  strmake(..., ..., -1).  Hence, I'm changing to

  if (dir_len >= FN_REFLEN)
    dir_len=FN_REFLEN-1;


>>     if (error_len)
>>     {
>> -      strmake(buff, error, min(sizeof(buff), error_len));
>> +      strmake(buff, error, min(sizeof(buff) - 1, error_len));
>>       goto err;
>
> I'm confused here : the '-1' is already present in my 4.1-opt tree ?

  It's possible.  That's Bug#31588, the one that started it all.
  That was pushed to -maint back when, so when I started fixing
  the other ones, it was not in -opt yet.



>> +#ifdef EXTRA_DEBUG
>> +  memset((char*) forminfo+47 + forminfo[46], 0, 61 - forminfo[46]);
>> +#endif
>
> Please add a comment here why this memset() is needed.

  Aye.

  thanks/regards,
  Tatjana


-- 
Tatjana A. Nurnberg, Bugs Bunny * MySQL AB, http://www.mysql.de/ * EST
IRC: Azundris * Skype: azundris * MySQL-SIP: 4550 * eMail: azundris@stripped
.de: Firmensitz: MySQL GmbH, Radlkoferstr. 2, D-81373 Muenchen
     Geschaeftsfuehrer: Hans von Bell, Kaj Arnoe - HRB Muenchen 162140
Thread
bk commit into 4.1 tree (tnurnberg:1.2686) BUG#31752Tatjana A Nuernberg26 Nov
  • Re: bk commit into 4.1 tree (tnurnberg:1.2686) BUG#31752Georgi Kodinov29 Nov
    • Re: bk commit into 4.1 tree (tnurnberg:1.2686) BUG#31752Tatjana Azundris Nurnberg6 Dec