~alestic/ec2-consistent-snapshot/trunk

« back to all changes in this revision

Viewing changes to ec2-consistent-snapshot

  • Committer: Eric Hammond
  • Date: 2012-11-21 22:53:15 UTC
  • Revision ID: ehammond@thinksome.com-20121121225315-rlzt3e6h3eei4vu0
Don't output slave information for a slave promoted to master.
Patch provided by Todd Roman.
(closes: bug#922068 on launchpad)
(fixes #6 on github)

Show diffs side-by-side

added added

removed removed

Lines of Context:
303
303
  if ( not $Noaction ) {
304
304
    # This might be a slave database already
305
305
    my $slave_status = $mysql_dbh->selectrow_hashref(q{ SHOW SLAVE STATUS });
306
 
    $mysql_logfile           = $slave_status->{Master_Log_File};
 
306
    $mysql_logfile           = $slave_status->{Slave_IO_State}
 
307
                             ? $slave_status->{Master_Log_File}
 
308
                             : undef;
307
309
    $mysql_position          = $slave_status->{Read_Master_Log_Pos};
308
310
    $mysql_binlog_do_db      = $slave_status->{Replicate_Do_DB};
309
311
    $mysql_binlog_ignore_db  = $slave_status->{Replicate_Ignore_DB};
850
852
  Craig Tracey
851
853
  Diego Salvi
852
854
  Christian Marquardt
 
855
  Todd Roman
853
856
 
854
857
=head1 AUTHOR
855
858