summaryrefslogtreecommitdiff
path: root/mysys/my_symlink2.c
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-02-23 13:59:04 -0800
committerunknown <jimw@mysql.com>2005-02-23 13:59:04 -0800
commita1db28a290643374df78809e418a3e80e141c694 (patch)
treef51e092086c91300bf59f2ff67c407425d2f51f9 /mysys/my_symlink2.c
parent8776230074184a255e8df4c5c4eb45e66fc81fe0 (diff)
downloadmariadb-git-a1db28a290643374df78809e418a3e80e141c694.tar.gz
Don't try to create a symlink if the DATA DIRECTORY specified for a table
is the same as the normal datadir for that database. (Bug #8707) mysys/my_symlink2.c: Expand path of linkname before checking it against filename to decide if we need to create a link. mysql-test/t/symlink.test: Add new regression test mysql-test/r/symlink.result: Add new results
Diffstat (limited to 'mysys/my_symlink2.c')
-rw-r--r--mysys/my_symlink2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c
index 913f632fbb4..80dca7d56ac 100644
--- a/mysys/my_symlink2.c
+++ b/mysys/my_symlink2.c
@@ -32,6 +32,7 @@ File my_create_with_symlink(const char *linkname, const char *filename,
int tmp_errno;
/* Test if we should create a link */
int create_link;
+ char abs_linkname[FN_REFLEN];
DBUG_ENTER("my_create_with_symlink");
if (my_disable_symlinks)
@@ -42,7 +43,11 @@ File my_create_with_symlink(const char *linkname, const char *filename,
filename= linkname;
}
else
- create_link= (linkname && strcmp(linkname,filename));
+ {
+ if (linkname)
+ my_realpath(&abs_linkname, linkname, MYF(0));
+ create_link= (linkname && strcmp(abs_linkname,filename));
+ }
if (!(MyFlags & MY_DELETE_OLD))
{