Skip to content

Commit e585dec

Browse files
author
Pavan Naik
committed
BUG#27448061: MYSQLD--DEFAULTS-FILE TEST FAILS FOR NDB RELEASES
PREVIOUS TO MYSQL 8.0 Description : ------------- The mysqld--defaults-file test fails when the test suite is run from a non-canonical path, which happens when the current working directory when mysql-test-run.pl is started contains a symbolic link. The problem is that this test case uses --replace-result with $MYSQL_TEST_DIR. This variable is a potentially non-canonical path based on the current working directory when mtr is started. However, the path in the expected error message from mysqld contains a canonical path. This means it does not contain $MYSQL_TEST_DIR if mtr's working directory is not the canonical path of the working directory. Because other tests produce output that may contain non-canonical paths, making $MYSQL_TEST_DIR always canonical is not a fix. Fix : ----- Introduced a new environment variable '$ABS_MYSQL_TEST_DIR' which will contin the canonical path to the test directory and replaced $MYSQL_TEST_DIR with the new variable in main.mysqld--defaults-file test file. This is a back-port of BUG#24579973. Change-Id: I3b8df6f2d7ce2b04e188a896d76250cc1addbbc1
1 parent 3fb2f8d commit e585dec

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

mysql-test/mysql-test-run.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl
22
# -*- cperl -*-
33

4-
# Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
4+
# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -2344,6 +2344,7 @@ sub environment_setup {
23442344
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
23452345
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
23462346
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
2347+
$ENV{'MYSQL_TEST_DIR_ABS'}= getcwd();
23472348
$ENV{'MYSQL_BINDIR'}= "$bindir";
23482349
$ENV{'MYSQL_SHAREDIR'}= $path_language;
23492350
$ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir;

mysql-test/t/mysqld--defaults-file.test

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ exec $MYSQLD --defaults-file=/path/with/no/extension --print-defaults 2>&1;
1313
--error 1
1414
exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1;
1515

16-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
16+
# Using $MYSQL_TEST_DIR_ABS which contains canonical path to the
17+
# test directory since --print-default prints the absolute path.
18+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
1719
--error 1
1820
exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1;
1921

20-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
22+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
2123
--error 1
2224
exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1;
2325

24-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
26+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
2527
--error 1
2628
exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
2729

28-
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
30+
--replace_result $MYSQL_TEST_DIR_ABS MYSQL_TEST_DIR
2931
--error 1
3032
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
3133

0 commit comments

Comments
 (0)