summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 408f3408346..7fff338df1c 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2602,7 +2602,9 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
else
{
- if (!access(fn_format(new_name_buff,new_name_buff,new_db,reg_ext,0),
+ char dir_buff[FN_REFLEN];
+ strxnmov(dir_buff, FN_REFLEN, mysql_real_data_home, new_db, NullS);
+ if (!access(fn_format(new_name_buff,new_name_buff,dir_buff,reg_ext,0),
F_OK))
{
/* Table will be closed in do_command() */