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:
None 
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
Description:
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

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.056 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.