Description:
There is a test case 'symlink' that is only to be run when the
'have_symlinks' server variable is set. On Windows this variable
seem to be set, but the functionality is lacking.
Also the test case fails in a bit strange way, setting DATA
DIRECTORY="tmp" succeeds instead of giving an error message.
This is likely confusing for the user, if the server lack this
functionality, giving an error message seems like the right
thing to do, instead of silently ignoring the argument. I suspect
this line in "sql_parse.cc" is causing this, just zeroing the
directory strings
#ifndef HAVE_READLINK
lex->create_info.data_file_name=lex->create_info.index_file_name=0;
#else
How to repeat:
Run the test case 'symlink' on Windows, using
% cd mysq-test
% ./mysql-test-run.pl symlinks
Suggested fix:
There seem to be some mix between HAVE_REALPATH and
HAVE_BROKEN_REALPATH. From reading the manual, having
realpath() seem to be a requirement to get symlink support.
It is not clear to me in what cases, when HAVE_REALPATH
is set, it is worth compiling in some of the support even if
HAVE_BROKEN_REALPATH is also set. So it migh be the
case that this is really about simplifying the code, like
in a header or configure set
#if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH)
#define HAVE_SYMLINKS 1
#endif
and only test for HAVE_SYMLINKS in the code.
To solve the immediate Windows problem, the following patch
will make sure 'have_symlink' is not set, and then disable
the test case 'symlinks' when running tests on Windows
--- 1.601/sql/mysqld.cc 2005-09-23 23:39:47 +02:00
+++ edited/sql/mysqld.cc 2005-09-24 07:35:49 +02:00
@@ -5879,7 +5879,7 @@
#else
have_openssl=SHOW_OPTION_NO;
#endif
-#ifdef HAVE_BROKEN_REALPATH
+#if !defined(HAVE_REALPATH) || defined(HAVE_BROKEN_REALPATH)
have_symlink=SHOW_OPTION_NO;
#else
have_symlink=SHOW_OPTION_YES;
@@ -6550,7 +6550,7 @@
usage();
exit(0);
}
-#if defined(HAVE_BROKEN_REALPATH)
+#if !defined(HAVE_REALPATH) || defined(HAVE_BROKEN_REALPATH)
my_use_symdir=0;
my_disable_symlinks=1;
have_symlink=SHOW_OPTION_NO;