1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Fix for bug #4815 (embedded server calculates wrong places for outfiles)

In some places in mysqld behaviour depends on system working directory
It works badly in libmysqld because user can set it in the way he needs.
I think we should explicitly insert mysql_real_data_home value in
paths in these places
This commit is contained in:
hf@deer.(none)
2004-08-24 22:45:32 +05:00
parent 56c807b2e0
commit 4629ae29de
2 changed files with 14 additions and 15 deletions

View File

@@ -854,12 +854,21 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange,
{
File file;
uint option= MY_UNPACK_FILENAME;
char buff[FN_REFLEN];
#ifdef DONT_ALLOW_FULL_LOAD_DATA_PATHS
option|= MY_REPLACE_DIR; // Force use of db directory
#endif
(void) fn_format(path, exchange->file_name, thd->db ? thd->db : "", "",
option);
char *cnt= strmake(buff, mysql_real_data_home, FN_REFLEN);
*cnt= FN_LIBCHAR;
cnt++;
cnt= strmake(cnt, thd->db ? thd->db : "", FN_REFLEN - (cnt-buff));
*cnt= FN_LIBCHAR;
cnt++;
*cnt= 0;
(void) fn_format(path, exchange->file_name, buff, "", option);
if (!access(path, F_OK))
{
my_error(ER_FILE_EXISTS_ERROR, MYF(0), exchange->file_name);