diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test
index 8b0d2803081ee995beec9927fbb4cdb64030d9ab..ca9c434e265074f088641b1d5952150f2f568cc5 100644
--- a/mysql-test/include/check-warnings.test
+++ b/mysql-test/include/check-warnings.test
@@ -42,7 +42,7 @@ if ($mysql_errno)
   let $old_log_error = $log_error-old;
   chmod 0644 $old_log_error;
   eval load data infile '$old_log_error' into table error_log (line)
-    set file_name='$log_error';
+    set file_name='$old_log_error';
 }
 
 # Call check_warnings to filter out any warning in