diff options
author | cmiller@zippy.(none) <> | 2006-07-10 16:38:03 -0400 |
---|---|---|
committer | cmiller@zippy.(none) <> | 2006-07-10 16:38:03 -0400 |
commit | e62e7300202f8bfc6adbc9046be32363da66e48b (patch) | |
tree | cd447a365439b84aa4058a2c9b41156838dc8701 /tests | |
parent | 244bdc96c3f5b6d61807591f682fbd1351a95730 (diff) | |
download | mariadb-git-e62e7300202f8bfc6adbc9046be32363da66e48b.tar.gz |
A patch to Bug#17667 didn't take into consideration that the vardir, which contains
the server's binlog file, might be set to a different directory. This adds a new
"vardir" parameter, which takes the name of the directory as a value, so that the
test_bug17667() test can find the binlog.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 3876de58b0e..2e8a3c7f4e9 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -58,6 +58,7 @@ static unsigned int iter_count= 0; static my_bool have_innodb= FALSE; static const char *opt_basedir= "./"; +static const char *opt_vardir= "mysql-test/var"; static longlong opt_getopt_ll_test= 0; @@ -14850,6 +14851,7 @@ static void test_bug17667() struct buffer_and_length *statement_cursor; FILE *log_file; + char *master_log_filename; myheader("test_bug17667"); @@ -14861,7 +14863,13 @@ static void test_bug17667() } sleep(1); /* The server may need time to flush the data to the log. */ - log_file= fopen("var/log/master.log", "r"); + + master_log_filename = (char *) malloc(strlen(opt_vardir) + strlen("/log/master.log") + 1); + strcpy(master_log_filename, opt_vardir); + strcat(master_log_filename, "/log/master.log"); + log_file= fopen(master_log_filename, "r"); + free(master_log_filename); + if (log_file != NULL) { for (statement_cursor= statements; statement_cursor->buffer != NULL; @@ -14883,8 +14891,8 @@ static void test_bug17667() printf("success. All queries found intact in the log.\n"); } else { - fprintf(stderr, "Could not find the log file, var/log/master.log, so " - "test_bug17667 is \ninconclusive. Run test from the " + fprintf(stderr, "Could not find the log file, VARDIR/log/master.log, " + "so test_bug17667 \nis inconclusive. Run test from the " "mysql-test/mysql-test-run* program \nto set up the correct " "environment for this test.\n\n"); } @@ -14971,6 +14979,8 @@ static struct my_option client_test_long_options[] = {"user", 'u', "User for login if not current user", (char **) &opt_user, (char **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif + {"vardir", 'v', "Data dir for tests.", (gptr*) &opt_vardir, + (gptr*) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"getopt-ll-test", 'g', "Option for testing bug in getopt library", (char **) &opt_getopt_ll_test, (char **) &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, |