diff --git a/mysql-test/t/myisam_recover.test b/mysql-test/t/myisam_recover.test
index 9056b219148..50bdf019a4b 100644
--- a/mysql-test/t/myisam_recover.test
+++ b/mysql-test/t/myisam_recover.test
@@ -88,6 +88,8 @@ flush table t1;
 --remove_file $MYSQLD_DATADIR/test/t1.MYI
 --copy_file $MYSQLD_DATADIR/test/t1_copy.MYI $MYSQLD_DATADIR/test/t1.MYI
 --remove_file $MYSQLD_DATADIR/test/t1_copy.MYI
+lock tables t1 write, t1_mrg write;
+flush table t1;
 --echo # check table is needed to mark the table as crashed.
 check table t1;
 --echo #
@@ -100,6 +102,8 @@ select * from t1_mrg;
 --echo #
 --echo # Cleanup
 --echo #
+unlock tables;
+select * from t1_mrg;
 drop table t1, t1_mrg;
 connection con1;
 unlock tables;
