68
68
static struct my_option my_long_options[] =
70
70
{"character-sets-dir", OPT_CHARSETS_DIR,
71
"Directory where character sets are.", (uchar**) &charsets_dir,
72
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
71
"Directory where character sets are.", (char**) &charsets_dir,
72
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
73
73
{"default-character-set", OPT_DEFAULT_CHARSET,
74
"Set the default character set.", (uchar**) &default_charset,
75
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
74
"Set the default character set.", (char**) &default_charset,
75
(char**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
77
77
"Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.",
78
(uchar**) &opt_columns, (uchar**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
78
(char**) &opt_columns, (char**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
80
80
{"compress", 'C', "Use compression in server/client protocol.",
81
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
81
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
83
83
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
84
84
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
85
85
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
86
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
86
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
87
87
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
88
88
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
89
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
89
(char**) &debug_info_flag, (char**) &debug_info_flag,
90
90
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
91
{"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete,
92
(uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
91
{"delete", 'd', "First delete all rows from table.", (char**) &opt_delete,
92
(char**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
93
93
{"fields-terminated-by", OPT_FTB,
94
"Fields in the textfile are terminated by ...", (uchar**) &fields_terminated,
95
(uchar**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
94
"Fields in the textfile are terminated by ...", (char**) &fields_terminated,
95
(char**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
96
96
{"fields-enclosed-by", OPT_ENC,
97
"Fields in the importfile are enclosed by ...", (uchar**) &enclosed,
98
(uchar**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
97
"Fields in the importfile are enclosed by ...", (char**) &enclosed,
98
(char**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
99
99
{"fields-optionally-enclosed-by", OPT_O_ENC,
100
"Fields in the i.file are opt. enclosed by ...", (uchar**) &opt_enclosed,
101
(uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
100
"Fields in the i.file are opt. enclosed by ...", (char**) &opt_enclosed,
101
(char**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
102
102
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
103
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
103
(char**) &escaped, (char**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
105
105
{"force", 'f', "Continue even if we get an sql-error.",
106
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
106
(char**) &ignore_errors, (char**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
108
108
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG,
109
109
0, 0, 0, 0, 0, 0},
110
{"host", 'h', "Connect to host.", (uchar**) ¤t_host,
111
(uchar**) ¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
110
{"host", 'h', "Connect to host.", (char**) ¤t_host,
111
(char**) ¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
112
112
{"ignore", 'i', "If duplicate unique key was found, keep old row.",
113
(uchar**) &ignore, (uchar**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
113
(char**) &ignore, (char**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
114
114
{"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
115
(uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL,
115
(char**) &opt_ignore_lines, (char**) &opt_ignore_lines, 0, GET_LL,
116
116
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
117
117
{"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
118
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
118
(char**) &lines_terminated, (char**) &lines_terminated, 0, GET_STR,
119
119
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
120
{"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file,
121
(uchar**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
120
{"local", 'L', "Read all files through the client.", (char**) &opt_local_file,
121
(char**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
122
122
{"lock-tables", 'l', "Lock all tables for write (this disables threads).",
123
(uchar**) &lock_tables, (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG,
123
(char**) &lock_tables, (char**) &lock_tables, 0, GET_BOOL, NO_ARG,
124
124
0, 0, 0, 0, 0, 0},
125
125
{"low-priority", OPT_LOW_PRIORITY,
126
"Use LOW_PRIORITY when updating the table.", (uchar**) &opt_low_priority,
127
(uchar**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
126
"Use LOW_PRIORITY when updating the table.", (char**) &opt_low_priority,
127
(char**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
128
128
{"password", 'p',
129
129
"Password to use when connecting to server. If password is not given it's asked from the tty.",
130
130
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
134
134
"/etc/services, "
136
136
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
137
(uchar**) &opt_mysql_port,
138
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
137
(char**) &opt_mysql_port,
138
(char**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
140
140
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
141
141
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
142
142
{"replace", 'r', "If duplicate unique key was found, replace old row.",
143
(uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
143
(char**) &replace, (char**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
145
145
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
146
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
146
"Base name of shared memory.", (char**) &shared_memory_base_name, (char**) &shared_memory_base_name,
147
147
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
149
{"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0,
149
{"silent", 's', "Be more silent.", (char**) &silent, (char**) &silent, 0,
150
150
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
151
151
{"socket", 'S', "Socket file to use for connection.",
152
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
152
(char**) &opt_mysql_unix_port, (char**) &opt_mysql_unix_port, 0, GET_STR,
153
153
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
154
154
{"use-threads", OPT_USE_THREADS,
155
155
"Load files in parallel. The argument is the number "
156
156
"of threads to use for loading data.",
157
(uchar**) &opt_use_threads, (uchar**) &opt_use_threads, 0,
157
(char**) &opt_use_threads, (char**) &opt_use_threads, 0,
158
158
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
159
159
#ifndef DONT_ALLOW_USER_CHANGE
160
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
161
(uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
160
{"user", 'u', "User for login if not current user.", (char**) ¤t_user,
161
(char**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
163
{"verbose", 'v', "Print info about the various stages.", (uchar**) &verbose,
164
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
163
{"verbose", 'v', "Print info about the various stages.", (char**) &verbose,
164
(char**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
165
165
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
166
166
NO_ARG, 0, 0, 0, 0, 0, 0},
167
167
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}