summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-02-27 03:49:26 +0200
committerunknown <monty@narttu.mysql.fi>2003-02-27 03:49:26 +0200
commite943ca1fc3765402c35cc918d686c4d37f36903d (patch)
tree0be3851671c59db010c557b551f49cc78c27f79a /sql/sql_load.cc
parent669cbe6e5fffb715e117a96273db9c95e229b3a9 (diff)
parent3f9ea80268126f8401bd27f03b842cd03cde7c9f (diff)
downloadmariadb-git-e943ca1fc3765402c35cc918d686c4d37f36903d.tar.gz
Merge with 4.0
mysql-test/r/bigint.result: Auto merged mysql-test/t/bigint.test: Auto merged sql/ha_innodb.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_load.cc: Auto merged sql/item.h: merge (use local copy) sql/sql_show.cc: merge
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 9415618c561..d387ebe27ae 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -91,7 +91,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
*enclosed=ex->enclosed;
bool is_fifo=0;
LOAD_FILE_INFO lf_info;
- char * db = table_list->db ? table_list->db : thd->db;
+ char *db = table_list->db; // This is never null
+ /* If no current database, use database where table is located */
+ char *tdb= thd->db ? thd->db : db;
bool transactional_table, log_delayed;
DBUG_ENTER("mysql_load");
@@ -173,10 +175,10 @@ 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(thd->db)+3 <
+ strlen(ex->file_name)+strlen(mysql_data_home)+strlen(tdb)+3 <
FN_REFLEN)
{
- (void) sprintf(name,"%s/%s/%s",mysql_data_home,thd->db,ex->file_name);
+ (void) sprintf(name,"%s/%s/%s",mysql_data_home,tdb,ex->file_name);
unpack_filename(name,name); /* Convert to system format */
}
else