summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmysql-test/mysql-test-run.pl3
-rw-r--r--mysql-test/t/mysqld--defaults-file.test10
2 files changed, 8 insertions, 5 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 2ca5c83e3f4..99d3203fb51 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- cperl -*-
-# Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -2344,6 +2344,7 @@ sub environment_setup {
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
+ $ENV{'MYSQL_TEST_DIR_ABS'}= getcwd();
$ENV{'MYSQL_BINDIR'}= "$bindir";
$ENV{'MYSQL_SHAREDIR'}= $path_language;
$ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir;
diff --git a/mysql-test/t/mysqld--defaults-file.test b/mysql-test/t/mysqld--defaults-file.test
index 3bfe0aa891f..e2d5b40adbc 100644
--- a/mysql-test/t/mysqld--defaults-file.test
+++ b/mysql-test/t/mysqld--defaults-file.test
@@ -13,19 +13,21 @@ exec $MYSQLD --defaults-file=/path/with/no/extension --print-defaults 2>&1;
--error 1
exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+# Using $MYSQL_TEST_DIR_ABS which contains canonical path to the
+# test directory since --print-default prints the absolute path.
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
--error 1
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;