diff options
author | elliot@mysql.com <> | 2005-06-06 22:17:16 -0400 |
---|---|---|
committer | elliot@mysql.com <> | 2005-06-06 22:17:16 -0400 |
commit | b906f31388b5c7c5a7cbd38b9a2f7b2f38b4b0c2 (patch) | |
tree | 8cddbf856b4c0235a840a8ce35c3651618d738ef /scripts/mysqlhotcopy.sh | |
parent | abb2d7aa347c0d12ad40fc04315167d3274baae0 (diff) | |
download | mariadb-git-b906f31388b5c7c5a7cbd38b9a2f7b2f38b4b0c2.tar.gz |
BUG#7967 Fix mysqlhotcopy --record-log-position
Diffstat (limited to 'scripts/mysqlhotcopy.sh')
-rw-r--r-- | scripts/mysqlhotcopy.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 632174dc41a..1c5cd6a4faf 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -746,9 +746,15 @@ sub record_log_pos { my ($file,$position) = get_row( $dbh, "show master status" ); die "master status is undefined" if !defined $file || !defined $position; - my ($master_host, undef, undef, undef, $log_file, $log_pos ) - = get_row( $dbh, "show slave status" ); - + my $row_hash = get_row_hash( $dbh, "show slave status" ); + my ($master_host, $log_file, $log_pos ); + if ( $dbh->{mysql_serverinfo} =~ /^3\.23/ ) { + ($master_host, $log_file, $log_pos ) + = @{$row_hash}{ qw / Master_Host Log_File Pos / }; + } else { + ($master_host, $log_file, $log_pos ) + = @{$row_hash}{ qw / Master_Host Master_Log_File Read_Master_Log_Pos / }; + } my $hostname = hostname(); $dbh->do( qq{ replace into $table_name @@ -773,6 +779,14 @@ sub get_row { return $sth->fetchrow_array(); } +sub get_row_hash { + my ( $dbh, $sql ) = @_; + + my $sth = $dbh->prepare($sql); + $sth->execute; + return $sth->fetchrow_hashref(); +} + sub scan_raid_dir { my ( $r_db_files, $data_dir, @raid_dir ) = @_; |