List:Internals« Previous MessageNext Message »
From:Kristian Nielsen Date:May 2 2011 1:25pm
Subject:Redundant code in binlog checksum?
View as plain text  

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?

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