1
0
mirror of https://github.com/MariaDB/server.git synced 2025-10-12 12:25:37 +03:00

A set of mysql_home_path-related fixes

This commit is contained in:
hf@deer.(none)
2004-09-07 11:55:34 +05:00
parent ea5fd2b4bb
commit c0458bb3b6
5 changed files with 31 additions and 14 deletions

View File

@@ -891,8 +891,15 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange,
option|= MY_REPLACE_DIR; // Force use of db directory
#endif
strxnmov(path, FN_REFLEN, mysql_real_data_home, thd->db ? thd->db : "");
(void) fn_format(path, exchange->file_name, path, "", option);
if (!dirname_length(path))
{
strxnmov(path, FN_REFLEN, mysql_real_data_home, thd->db ? thd->db : "", NullS);
(void) fn_format(path, exchange->file_name, path, "", option);
}
else
(void) fn_format(path, exchange->file_name, mysql_real_data_home, "", option);
if (!access(path, F_OK))
{
my_error(ER_FILE_EXISTS_ERROR, MYF(0), exchange->file_name);