diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc
index b3fd5e4717929312489961403ac7159b06bb068f..91e0eff1e0f47db650c4961226871244611228aa 100644
--- a/mysql-test/include/mysqlhotcopy.inc
+++ b/mysql-test/include/mysqlhotcopy.inc
@@ -5,7 +5,7 @@
 --source include/not_windows.inc
 --source include/not_embedded.inc
 
-if ($MYSQLHOTCOPY)
+if (!$MYSQLHOTCOPY)
 {
   die due to missing mysqlhotcopy tool;
 }
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index e10c1116f2ccd3db40b0d0fa7a7325148433a956..d9dd9d4829989de9cd26f3b69f2437329dcb5f38 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2145,7 +2145,10 @@ sub environment_setup {
     mtr_pl_maybe_exists("$basedir/scripts/mysqlhotcopy");
   # Since mysqltest interprets the real path as "false" in an if,
   # use 1 ("true") to indicate "not exists" so it can be tested for
-  $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy || 1;
+  if ($mysqlhotcopy)
+  {
+    $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy;
+  }
 
   # ----------------------------------------------------
   # perror