Bug #52346 do not ignore const in ::do_apply_event
Submitted: 24 Mar 2010 20:59 Modified: 24 Mar 2010 21:20
Reporter: Mark Callaghan Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: coding, replication, STANDARDS

[24 Mar 2010 20:59] Mark Callaghan
This should not be done. Fix the interface if 'rli' is not const.

int Query_log_event::do_apply_event(Relay_log_info const *rli,
                                      const char *query_arg, uint32 q_len_arg)
  const_cast<Relay_log_info*>(rli)->future_group_master_log_pos= log_pos;

This is also done in  Load_log_event::do_apply_event and Execute_load_log_event::do_apply_event

How to repeat:
read the source

Suggested fix:
change the interface
[24 Mar 2010 21:11] Sveta Smirnova
Thank you for the report.

Verified as described.

This is also in other methods where *rli is Relay_log_info const such as User_var_log_event::do_apply_event and Rand_log_event::do_apply_event
[24 Mar 2010 21:20] Mark Callaghan
yes, the file is full of const_cast