From b4ee4d358a316b1bba5dbb4faf51e6d0f7ab0e33 Mon Sep 17 00:00:00 2001 From: "rburnett@build.mysql.com" <> Date: Mon, 4 Oct 2004 20:26:43 +0200 Subject: Bug #5829 mysqlimport garbles path of the file to be imported Original code was checking ! unix_socket for local_file flag. This doesn't work and so was removed. Now to import a local file, you must use the --local command line option. mysqlimport.c: Removed check of unix_socket to set local_file --- client/mysqlimport.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/mysqlimport.c b/client/mysqlimport.c index ca53b74c119..50c3a26a882 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -246,10 +246,8 @@ static int write_to_table(char *filename, MYSQL *sock) DBUG_ENTER("write_to_table"); DBUG_PRINT("enter",("filename: %s",filename)); - local_file= sock->unix_socket == 0 || opt_local_file; - fn_format(tablename, filename, "", "", 1 | 2); /* removes path & ext. */ - if (local_file) + if (! opt_local_file) strmov(hard_path,filename); else my_load_path(hard_path, filename, NULL); /* filename includes the path */ @@ -268,7 +266,7 @@ static int write_to_table(char *filename, MYSQL *sock) to_unix_path(hard_path); if (verbose) { - if (local_file) + if (opt_local_file) fprintf(stdout, "Loading data from LOCAL file: %s into %s\n", hard_path, tablename); else @@ -277,7 +275,7 @@ static int write_to_table(char *filename, MYSQL *sock) } sprintf(sql_statement, "LOAD DATA %s %s INFILE '%s'", opt_low_priority ? "LOW_PRIORITY" : "", - local_file ? "LOCAL" : "", hard_path); + opt_local_file ? "LOCAL" : "", hard_path); end= strend(sql_statement); if (replace) end= strmov(end, " REPLACE"); -- cgit v1.2.1