List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:October 12 2007 7:26pm
Subject:Re: bk commit into 5.1 tree (aelkin:1.2653) BUG#20435
View as plain text  
Mats, good evening.



> Hi Andrei!
>
> Patch is OK, but read my comments below. Patch is OK to push after you
> have considered my comments below.
>

Thanks for working with us on it!

>> +      /*
>> +        Starting from 5.1.XX master_heartbeat_period might be
>> +        in the file
>> +      */
>>   
>
> You forgot to change to 5.1.23

right. Now fixed.


>>  +  if (mi->heartbeat_period != 0.0)
>> +  {
>> +    char buf[18 + 1];  // 18 max digits for %ll plus terminating zero
>> +    const char* query_format= "SET @master_heartbeat_period= %s";
>> +    char query[(strlen(query_format) - 2) + (18 + 1)];
>>   
>
> const char query_format[] = "SET @master_heartbeat_period= %s";
> char query[sizeof(query_format) - 2 + sizeof(buf)];
>

Good point, esp with sizeof(buf). Minor but nice.
However,

char buf[18] then :) 

Because the terminating byte is "transferred" to
sizeof(query_format) from strlen(query_format).


cheers,

Andrei
Thread
bk commit into 5.1 tree (aelkin:1.2653) BUG#20435Andrei Elkin11 Oct
  • Re: bk commit into 5.1 tree (aelkin:1.2653) BUG#20435Mats Kindahl12 Oct
    • Re: bk commit into 5.1 tree (aelkin:1.2653) BUG#20435Andrei Elkin12 Oct