List:Internals« Previous MessageNext Message »
From:Mats Kindahl Date:May 3 2011 9:25am
Subject:Re: Redundant code in binlog checksum?
View as plain text  
On 05/02/2011 03:25 PM, Kristian Nielsen wrote:
> Hi,
> I am currently looking at the WL#2540 binlog checksum code in lp:mysql-server.
> I stumbled upon the following code, which looks strange:
> static ulong fix_log_event_crc(uchar *buf, uint off, uint event_len,
>                                  uint length, ha_checksum *crc)
> {
>   ...
>   uint16 flags= uint2korr(event_begin + FLAGS_OFFSET);
>   DBUG_ASSERT(length >= off + LOG_EVENT_HEADER_LEN); //at least common header in
>   int2store(event_begin + FLAGS_OFFSET, flags);
>   ...
> }
> The "flags" is read out, the written back in the same place, without ever
> being changed or accessed. That looks strange and redundant?
> Maybe there used to be a flag associated with the binlog checksum feature (the
> worklog text still has reference to such flag), but when the flag was deleted
> the reading/writing of the flag bytes was accidentally left in place? Or am I
> missing something?

Hi Kristian,

It seems indeed to be some "leftovers" from some earlier patch needing
to store the flags back again.

Thanks for the heads-up!

Best wishes,
Mats Kindahl

>  - Kristian.

Redundant code in binlog checksum?Kristian Nielsen2 May
  • Re: Redundant code in binlog checksum?Mats Kindahl3 May