Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b5e0d41f
Commit
b5e0d41f
authored
Aug 07, 2001
by
tim@white.box
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --default-character-set option to mysqlimport. Thanks to
takeshi@softagent.co.jp for the patch.
parent
3a4eb0e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
client/mysqlimport.c
client/mysqlimport.c
+14
-2
No files found.
client/mysqlimport.c
View file @
b5e0d41f
...
@@ -48,17 +48,19 @@ static MYSQL mysql_connection;
...
@@ -48,17 +48,19 @@ static MYSQL mysql_connection;
static
char
*
opt_password
=
0
,
*
current_user
=
0
,
static
char
*
opt_password
=
0
,
*
current_user
=
0
,
*
current_host
=
0
,
*
current_db
=
0
,
*
fields_terminated
=
0
,
*
current_host
=
0
,
*
current_db
=
0
,
*
fields_terminated
=
0
,
*
lines_terminated
=
0
,
*
enclosed
=
0
,
*
opt_enclosed
=
0
,
*
lines_terminated
=
0
,
*
enclosed
=
0
,
*
opt_enclosed
=
0
,
*
escaped
=
0
,
opt_low_priority
=
0
,
*
opt_columns
=
0
;
*
escaped
=
0
,
opt_low_priority
=
0
,
*
opt_columns
=
0
,
*
default_charset
;
static
uint
opt_mysql_port
=
0
;
static
uint
opt_mysql_port
=
0
;
static
my_string
opt_mysql_unix_port
=
0
;
static
my_string
opt_mysql_unix_port
=
0
;
#include "sslopt-vars.h"
#include "sslopt-vars.h"
enum
options
{
OPT_FTB
=
256
,
OPT_LTB
,
OPT_ENC
,
OPT_O_ENC
,
OPT_ESC
,
enum
options
{
OPT_FTB
=
256
,
OPT_LTB
,
OPT_ENC
,
OPT_O_ENC
,
OPT_ESC
,
OPT_LOW_PRIORITY
,
OPT_CHARSETS_DIR
};
OPT_LOW_PRIORITY
,
OPT_CHARSETS_DIR
,
OPT_DEFAULT_CHARSET
};
static
struct
option
long_options
[]
=
static
struct
option
long_options
[]
=
{
{
{
"character-sets-dir"
,
required_argument
,
0
,
OPT_CHARSETS_DIR
},
{
"character-sets-dir"
,
required_argument
,
0
,
OPT_CHARSETS_DIR
},
{
"default-character-set"
,
required_argument
,
0
,
OPT_DEFAULT_CHARSET
},
{
"columns"
,
required_argument
,
0
,
'c'
},
{
"columns"
,
required_argument
,
0
,
'c'
},
{
"compress"
,
no_argument
,
0
,
'C'
},
{
"compress"
,
no_argument
,
0
,
'C'
},
{
"debug"
,
optional_argument
,
0
,
'#'
},
{
"debug"
,
optional_argument
,
0
,
'#'
},
...
@@ -119,6 +121,8 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
...
@@ -119,6 +121,8 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
printf
(
"
\n
\
printf
(
"
\n
\
-#, --debug[=...] Output debug log. Often this is 'd:t:o,filename`
\n
\
-#, --debug[=...] Output debug log. Often this is 'd:t:o,filename`
\n
\
-?, --help Displays this help and exits.
\n
\
-?, --help Displays this help and exits.
\n
\
--default-character-set=...
\n
\
Set the default character set.
\n
\
--character-sets-dir=...
\n
\
--character-sets-dir=...
\n
\
Directory where character sets are
\n
\
Directory where character sets are
\n
\
-c, --columns=... Use only these columns to import the data to.
\n
\
-c, --columns=... Use only these columns to import the data to.
\n
\
...
@@ -179,6 +183,9 @@ static int get_options(int *argc, char ***argv)
...
@@ -179,6 +183,9 @@ static int get_options(int *argc, char ***argv)
case
'C'
:
case
'C'
:
opt_compress
=
1
;
opt_compress
=
1
;
break
;
break
;
case
OPT_DEFAULT_CHARSET
:
default_charset
=
optarg
;
break
;
case
OPT_CHARSETS_DIR
:
case
OPT_CHARSETS_DIR
:
charsets_dir
=
optarg
;
charsets_dir
=
optarg
;
break
;
break
;
...
@@ -269,6 +276,11 @@ static int get_options(int *argc, char ***argv)
...
@@ -269,6 +276,11 @@ static int get_options(int *argc, char ***argv)
fprintf
(
stderr
,
"You can't use --ignore (-i) and --replace (-r) at the same time.
\n
"
);
fprintf
(
stderr
,
"You can't use --ignore (-i) and --replace (-r) at the same time.
\n
"
);
return
(
1
);
return
(
1
);
}
}
if
(
default_charset
)
{
if
(
set_default_charset_by_name
(
default_charset
,
MYF
(
MY_WME
)))
exit
(
1
);
}
(
*
argc
)
-=
optind
;
(
*
argc
)
-=
optind
;
(
*
argv
)
+=
optind
;
(
*
argv
)
+=
optind
;
if
(
*
argc
<
2
)
if
(
*
argc
<
2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment