=== modified file 'mysql-test/suite/backup/t/backup_myisam.test' --- mysql-test/suite/backup/t/backup_myisam.test 2008-12-30 12:13:31 +0000 +++ mysql-test/suite/backup/t/backup_myisam.test 2009-02-06 08:57:18 +0000 @@ -2,8 +2,14 @@ # Tests with MyISAM native driver. # +--source include/have_debug_sync.inc --source include/not_embedded.inc +connect(con1, localhost, root,,); +connect(con2, localhost, root,,); + +connection default; + # # Precautionary cleanup # @@ -36,9 +42,24 @@ --replace_column 1 # BACKUP DATABASE mysql_db1 to 'bup_myisam.bak'; --replace_column 1 # -RESTORE FROM 'bup_myisam.bak' OVERWRITE; + +SET DEBUG_SYNC= 'after_restore_locks_tables SIGNAL wait_for_restore WAIT_FOR finish'; +send RESTORE FROM 'bup_myisam.bak' OVERWRITE; + +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR wait_for_restore'; +send SELECT COUNT(*) FROM mysql_db1.t1 WHERE c2 < 5; + +connection con2; +SET DEBUG_SYNC= 'now SIGNAL finish'; + +connection default; +reap; + +connection con1; +reap; + # -SELECT COUNT(*) FROM mysql_db1.t1 WHERE c2 < 5; # # Cleanup # === modified file 'sql/backup/kernel.cc' --- sql/backup/kernel.cc 2009-02-03 07:48:09 +0000 +++ sql/backup/kernel.cc 2009-02-06 09:13:32 +0000 @@ -1324,10 +1324,14 @@ close_thread_tables(m_thd); // Never errors m_thd->stmt_da->reset_diagnostics_area(); // Never errors + DEBUG_SYNC(m_thd, "before_restore_locks_tables"); + err= lock_tables_for_restore(); // logs errors if (err) DBUG_RETURN(fatal_error(err)); + DEBUG_SYNC(m_thd, "after_restore_locks_tables"); + /* Here restore drivers are created to restore table data. Data is being (potentially) changed so we set m_data_changed flag.