Skip to content
Snippets Groups Projects
Commit c7c6ca03 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Always read-lock the tables on the source server.

Run myisamchk without --quick so that it actually repairs broken tables.
Add --slient (twice) to make it silent.
parent 0bbe43f9
No related branches found
No related tags found
No related merge requests found
......@@ -471,12 +471,13 @@ foreach my $spec (@todo) {
}
}
if ($opt_flush) {
# Lock and flush tables.
# Lock tables with a read lock.
print("LOCKING TABLES...\n");
$source_dbh->do(
sprintf( "LOCK TABLES %s READ", join( ' READ, ', @tables ) ) );
print("LOCKING TABLES...\n");
$source_dbh->do(
sprintf( "LOCK TABLES %s READ", join( ' READ, ', @tables ) ) );
if ($opt_flush) {
# Flush tables.
print("FLUSHING TABLES...\n");
$source_dbh->do(
......@@ -542,11 +543,9 @@ foreach my $spec (@todo) {
$failed = 1;
}
if ($opt_flush) {
# Unlock tables.
print("UNLOCKING TABLES...\n");
$source_dbh->do('UNLOCK TABLES');
}
# Unlock tables.
print("UNLOCKING TABLES...\n");
$source_dbh->do('UNLOCK TABLES');
$source_dbh->disconnect();
......@@ -575,11 +574,12 @@ foreach my $spec (@todo) {
'--check',
'--check-only-changed',
'--update-state',
'--quick',
'--silent',
'--silent', # Yes, twice.
map { catfile( $staging_dir, $_ ) } @tables
);
print("CHECKING TABLES (ignore warnings from myisamchk)...\n");
print("CHECKING TABLES...\n");
if ( system(@check_cmd) != 0 ) {
warn(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment