List:Internals« Previous MessageNext Message »
From:Jorge Bernal Ordovás Date:April 20 2007 1:11am
Subject:Re: Review 1 of patch 2 for #27894: mysqlbinlog formats timestamp wrong in comment
View as plain text  
On 19/04/2007, at 15:58, Chad MILLER wrote:
>
> Tabs again.  :\  ':set expandtabs" if you're using vi.
>
Oops, I configured my text editor, but I guess those where from the  
first changes

> I hate to see the magical value "17".  I'm ashamed to see it in the  
> surrounding code.
>
> But, in this case, it's not the same "17" -- the others are  
> locations to represent numbers, whereas this is padding.  "%09000d"  
> is at least legal, though unlikely, right?  That would try to write  
> 8983 bytes past the end of buffz.
>
> I suggest making a for-loop and write chunks of padding or (I don't  
> like as much) use my_alloca() to allocate one up front, and pack  
> it, and then write it.

I think the second case is what I was looking for. Anyway, is there  
anything bad about doing a for-loop and my_b_write(info, '0', 1) in  
terms or perfomance. Or it's just it feels wrong (I get that feeling  
but not sure why yet)?

>
>> +		if (is_zero_padded)
>> +			memset(buffz, '0', minimum_width - length2);
>> +		else
>> +			memset(buffz, ' ', minimum_width - length2);
>> +		my_b_write(info, buffz, minimum_width - length2);
>> +	}
>>        out_length+= length2;
>>        if (my_b_write(info, buff, length2))
>> 	goto err;
>
> It's getting very close.
>

Great, thanks
	Koke

> - chad
>
> --
> Chad Miller, Software Developer                         chad@stripped
> MySQL Inc., www.mysql.com
> Orlando, Florida, USA                                13-20z,  UTC-0400
> Office: +1 408 213 6740                         sip:6740@stripped
>
>

--
Jorge Bernal Ordovás  <jbernal@stripped>
http://amedias.org/ [ES]
http://koke.amedias.org/ [EN]

Warp Networks         http://www.warp.es/
D. Jaime I 33 3º Dcha, 50001 Zaragoza, Spain


Thread
[PATCH] Proposed patch for #27894: mysqlbinlog formats timestamp wrong in commentJorge Bernal19 Apr
Re: [PATCH] Proposed patch for #27894: mysqlbinlog formats timestamp wrong in commentJorge Bernal Ordovás19 Apr
  • Review 1 of patch 1 for #27894: mysqlbinlog formats timestamp wrong in commentChad MILLER19 Apr
    • Re: Review 1 of patch 1 for #27894: mysqlbinlog formats timestamp wrong in commentJorge Bernal Ordovás19 Apr
      • Review 1 of patch 2 for #27894: mysqlbinlog formats timestamp wrong in commentChad MILLER20 Apr
        • Re: Review 1 of patch 2 for #27894: mysqlbinlog formats timestamp wrong in commentJorge Bernal Ordovás20 Apr
          • Re: Review 1 of patch 2 for #27894: mysqlbinlog formats timestamp wrong in commentChad MILLER20 Apr
            • Re: Review 1 of patch 2 for #27894: mysqlbinlog formats timestamp wrong in commentSergei Golubchik20 Apr
        • Re: Review 1 of patch 2 for #27894: mysqlbinlog formats timestamp wrong in commentJorge Bernal Ordovás20 Apr
          • Patch 3 for #27894: mysqlbinlog formats timestamp wrong in commentChad MILLER20 Apr
            • Re: Patch 3 for #27894: mysqlbinlog formats timestamp wrong incommentLenz Grimmer22 Apr
              • Re: Patch 3 for #27894: mysqlbinlog formats timestamp wrong in commentJorge Bernal Ordovás22 Apr
                • Re: Patch 3 for #27894: mysqlbinlog formats timestamp wrong incommentLenz Grimmer23 Apr
  • Re: [PATCH] Proposed patch for #27894: mysqlbinlog formats timestamp wrong in commentJorge Bernal Ordovás19 Apr