Bug #78722 Relay log info currently_executing_gtid is not properly initialized or protected
Submitted: 6 Oct 2015 16:38 Modified: 21 Mar 2016 16:28
Reporter: Pedro Gomes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[6 Oct 2015 16:38] Pedro Gomes
Description:
When replication is configured but not started on a slave, the relay log info 
variable "currently_executing_gtid" is not properly initialized.
This variable is mapped to the field "last_seen_transaction" on the PFS table 
"replication_applier_status_by_worker"

On systems that do not initialize this variable type to 0 but to a random
number, this leads to assert failures when we try to read this table, and 
possible null pointers if the assert is not present. 

How to repeat:
--source include/not_group_replication_plugin.inc
--let $rpl_skip_start_slave= 1
--let $use_gtids= 1
source include/master-slave.inc;

connection slave;
SELECT  last_seen_transaction FROM performance_schema.replication_applier_status_by_worker;

Suggested fix:
Find a way to properly initialize it or in the 
table_replication_applier_status_by_worker.cc protect the variable with something like:

  if (mi->rli->slave_running)
  {
    current code
  }
  else
  {
    m_row.last_seen_transaction_length= 0;
    memcpy(m_row.last_seen_transaction, "", 1);
  }
[21 Mar 2016 16:28] Daniel So
Added the following entry to the MySQL server 5.7.12 and 5.8.0 changelgos:

"When replication was configured but not started on a slave, the variable currently_executing_gtid was not properly initialized, but it would be used if the performance_schema table replication_applier_status_by_worker was queried, causing assertion failures and pointer issues. With this fix, the variable is now properly initialized at the construction of the Relay_log_info object."