summaryrefslogtreecommitdiff
path: root/client/mysqlimport.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2009-10-21 17:59:47 +0500
committerAlexander Barkov <bar@mysql.com>2009-10-21 17:59:47 +0500
commit99eae48a97fdf4399ca55b7e28ff97a9332f0f23 (patch)
tree9daa322eb14aa0cd7af60162e5b2b6c77446def6 /client/mysqlimport.c
parent1b26332898746bd3738fec850eb1206114c19448 (diff)
downloadmariadb-git-99eae48a97fdf4399ca55b7e28ff97a9332f0f23.tar.gz
WL#1349 Use operating system localization to send it as a default client character set
Diffstat (limited to 'client/mysqlimport.c')
-rw-r--r--client/mysqlimport.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index ef38d760e5d..5b8ec95c06d 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -55,11 +55,10 @@ static char *opt_password=0, *current_user=0,
*current_host=0, *current_db=0, *fields_terminated=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0,
*escaped=0, *opt_columns=0,
- *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
+ *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static uint opt_mysql_port= 0, opt_protocol= 0;
static char * opt_mysql_unix_port=0;
static longlong opt_ignore_lines= -1;
-static CHARSET_INFO *charset_info= &my_charset_latin1;
#include <sslopt-vars.h>
#ifdef HAVE_SMEM
@@ -282,10 +281,6 @@ static int get_options(int *argc, char ***argv)
fprintf(stderr, "You can't use --ignore (-i) and --replace (-r) at the same time.\n");
return(1);
}
- if (strcmp(default_charset, charset_info->csname) &&
- !(charset_info= get_charset_by_csname(default_charset,
- MY_CS_PRIMARY, MYF(MY_WME))))
- exit(1);
if (*argc < 2)
{
usage();
@@ -440,6 +435,7 @@ static MYSQL *db_connect(char *host, char *database,
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
+ mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(mysql,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,
0)))