mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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 sql/sql_class.cc: here we concat mysql_real_data_home and thd->db to be the prefix sql/sql_load.cc: it's better to build the prefix from mysql_real_data_home also i think it's better always to call my_load_path to not to depend of current system working directory
This commit is contained in:
@ -180,7 +180,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
||||
ex->file_name+=dirname_length(ex->file_name);
|
||||
#endif
|
||||
if (!dirname_length(ex->file_name) &&
|
||||
strlen(ex->file_name)+strlen(mysql_data_home)+strlen(tdb)+3 <
|
||||
strlen(ex->file_name)+strlen(mysql_real_data_home)+strlen(tdb)+3 <
|
||||
FN_REFLEN)
|
||||
{
|
||||
(void) sprintf(name,"%s/%s/%s",mysql_data_home,tdb,ex->file_name);
|
||||
@ -188,18 +188,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
char *chk_name= ex->file_name;
|
||||
while ((*chk_name == ' ') || (*chk_name == 't'))
|
||||
chk_name++;
|
||||
if (*chk_name == FN_CURLIB)
|
||||
{
|
||||
sprintf(name, "%s%s", mysql_data_home, ex->file_name);
|
||||
unpack_filename(name, name);
|
||||
}
|
||||
else
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
unpack_filename(name,ex->file_name);
|
||||
my_load_path(name, ex->file_name, mysql_real_data_home);
|
||||
unpack_filename(name, name);
|
||||
#if !defined(__WIN__) && !defined(OS2) && ! defined(__NETWARE__)
|
||||
MY_STAT stat_info;
|
||||
if (!my_stat(name,&stat_info,MYF(MY_WME)))
|
||||
|
Reference in New Issue
Block a user