235
228
static char *get_arg(char *line, bool get_next_arg);
236
229
static void init_username(void);
237
230
static void add_int_to_prompt(int toadd);
238
static int get_result_width(DRIZZLE_RES *res);
239
static int get_field_disp_length(DRIZZLE_FIELD * field);
240
static const char * strcont(register const char *str, register const char *set);
231
static int get_result_width(MYSQL_RES *res);
232
static int get_field_disp_length(MYSQL_FIELD * field);
242
234
/* A structure which contains information on the commands this program
243
235
can understand. */
245
const char *name; /* User printable name of the function. */
246
char cmd_char; /* msql command character */
247
int (*func)(string *str,const char *); /* Function to call to do the job. */
248
bool takes_params; /* Max parameters for command */
249
const char *doc; /* Documentation for this function. */
237
const char *name; /* User printable name of the function. */
238
char cmd_char; /* msql command character */
239
int (*func)(GString *str,char *); /* Function to call to do the job. */
240
bool takes_params; /* Max parameters for command */
241
const char *doc; /* Documentation for this function. */
253
245
static COMMANDS commands[] = {
254
{ "?", '?', com_help, 1, N_("Synonym for `help'.") },
255
{ "clear", 'c', com_clear, 0, N_("Clear command.")},
246
{ "?", '?', com_help, 1, "Synonym for `help'." },
247
{ "clear", 'c', com_clear, 0, "Clear command."},
256
248
{ "connect",'r', com_connect,1,
257
N_("Reconnect to the server. Optional arguments are db and host." }),
249
"Reconnect to the server. Optional arguments are db and host." },
258
250
{ "delimiter", 'd', com_delimiter, 1,
259
N_("Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.") },
251
"Set statement delimiter. NOTE: Takes the rest of the line as new delimiter." },
260
252
{ "ego", 'G', com_ego, 0,
261
N_("Send command to drizzle server, display result vertically.")},
262
{ "exit", 'q', com_quit, 0, N_("Exit drizzle. Same as quit.")},
263
{ "go", 'g', com_go, 0, N_("Send command to drizzle server.") },
264
{ "help", 'h', com_help, 1, N_("Display this help.") },
265
{ "nopager",'n', com_nopager,0, N_("Disable pager, print to stdout.") },
266
{ "notee", 't', com_notee, 0, N_("Don't write into outfile.") },
253
"Send command to mysql server, display result vertically."},
254
{ "exit", 'q', com_quit, 0, "Exit mysql. Same as quit."},
255
{ "go", 'g', com_go, 0, "Send command to mysql server." },
256
{ "help", 'h', com_help, 1, "Display this help." },
257
{ "nopager",'n', com_nopager,0, "Disable pager, print to stdout." },
258
{ "notee", 't', com_notee, 0, "Don't write into outfile." },
267
259
{ "pager", 'P', com_pager, 1,
268
N_("Set PAGER [to_pager]. Print the query results via PAGER.") },
269
{ "print", 'p', com_print, 0, N_("Print current command.") },
270
{ "prompt", 'R', com_prompt, 1, N_("Change your drizzle prompt.")},
271
{ "quit", 'q', com_quit, 0, N_("Quit drizzle.") },
272
{ "rehash", '#', com_rehash, 0, N_("Rebuild completion hash.") },
260
"Set PAGER [to_pager]. Print the query results via PAGER." },
261
{ "print", 'p', com_print, 0, "Print current command." },
262
{ "prompt", 'R', com_prompt, 1, "Change your mysql prompt."},
263
{ "quit", 'q', com_quit, 0, "Quit mysql." },
264
{ "rehash", '#', com_rehash, 0, "Rebuild completion hash." },
273
265
{ "source", '.', com_source, 1,
274
N_("Execute an SQL script file. Takes a file name as an argument.")},
275
{ "status", 's', com_status, 0, N_("Get status information from the server.")},
266
"Execute an SQL script file. Takes a file name as an argument."},
267
{ "status", 's', com_status, 0, "Get status information from the server."},
276
268
{ "tee", 'T', com_tee, 1,
277
N_("Set outfile [to_outfile]. Append everything into given outfile.") },
269
"Set outfile [to_outfile]. Append everything into given outfile." },
278
270
{ "use", 'u', com_use, 1,
279
N_("Use another database. Takes database name as argument.") },
271
"Use another database. Takes database name as argument." },
272
{ "charset", 'C', com_charset, 1,
273
"Switch to another charset. Might be needed for processing binlog with multi-byte charsets." },
280
274
{ "warnings", 'W', com_warnings, 0,
281
N_("Show warnings after every statement.") },
275
"Show warnings after every statement." },
282
276
{ "nowarning", 'w', com_nowarnings, 0,
283
N_("Don't show warnings after every statement.") },
277
"Don't show warnings after every statement." },
284
278
/* Get bash-like expansion for some commands */
285
279
{ "create table", 0, 0, 0, ""},
286
280
{ "create database", 0, 0, 0, ""},
1265
1263
static struct my_option my_long_options[] =
1267
{"help", '?', N_("Display this help and exit."), 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
1265
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
1268
1266
0, 0, 0, 0, 0},
1269
{"help", 'I', N_("Synonym for -?"), 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
1267
{"help", 'I', "Synonym for -?", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
1270
1268
0, 0, 0, 0, 0},
1271
1269
{"auto-rehash", OPT_AUTO_REHASH,
1272
N_("Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash."),
1270
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
1273
1271
(char**) &opt_rehash, (char**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
1275
1273
{"no-auto-rehash", 'A',
1276
N_("No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of DRIZZLE and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead."),
1274
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
1277
1275
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1278
1276
{"auto-vertical-output", OPT_AUTO_VERTICAL_OUTPUT,
1279
N_("Automatically switch to vertical output mode if the result is wider than the terminal width."),
1277
"Automatically switch to vertical output mode if the result is wider than the terminal width.",
1280
1278
(char**) &auto_vertical_output, (char**) &auto_vertical_output, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1282
N_("Don't use history file. Disable interactive behavior. (Enables --silent)"), 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1280
"Don't use history file. Disable interactive behavior. (Enables --silent)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1283
1281
{"character-sets-dir", OPT_CHARSETS_DIR,
1284
N_("Directory where character sets are."), (char**) &charsets_dir,
1282
"Directory where character sets are.", (char**) &charsets_dir,
1285
1283
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1286
{"column-type-info", OPT_COLUMN_TYPES, N_("Display column type information."),
1284
{"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
1287
1285
(char**) &column_types_flag, (char**) &column_types_flag,
1288
1286
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1289
{"comments", 'c', N_("Preserve comments. Send comments to the server. The default is --skip-comments (discard comments), enable with --comments"),
1287
{"comments", 'c', "Preserve comments. Send comments to the server."
1288
" The default is --skip-comments (discard comments), enable with --comments",
1290
1289
(char**) &preserve_comments, (char**) &preserve_comments,
1291
1290
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1292
{"compress", 'C', N_("Use compression in server/client protocol."),
1291
{"compress", 'C', "Use compression in server/client protocol.",
1293
1292
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1295
{"debug-check", OPT_DEBUG_CHECK, N_("Check memory and open file usage at exit ."),
1294
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
1296
1295
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
1297
1296
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1298
{"debug-info", 'T', N_("Print some debug info at exit."), (char**) &debug_info_flag,
1297
{"debug-info", 'T', "Print some debug info at exit.", (char**) &debug_info_flag,
1299
1298
(char**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1300
{"database", 'D', N_("Database to use."), (char**) ¤t_db,
1299
{"database", 'D', "Database to use.", (char**) ¤t_db,
1301
1300
(char**) ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1302
1301
{"default-character-set", OPT_DEFAULT_CHARSET,
1303
N_("(not used)"), 0,
1304
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1305
{"delimiter", OPT_DELIMITER, N_("Delimiter to be used."), (char**) &delimiter_str,
1302
"Set the default character set.", (char**) &default_charset,
1303
(char**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1304
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (char**) &delimiter_str,
1306
1305
(char**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1307
{"execute", 'e', N_("Execute command and quit. (Disables --force and history file)"), 0,
1306
{"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0,
1308
1307
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1309
{"vertical", 'E', N_("Print the output of a query (rows) vertically."),
1308
{"vertical", 'E', "Print the output of a query (rows) vertically.",
1310
1309
(char**) &vertical, (char**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
1312
{"force", 'f', N_("Continue even if we get an sql error."),
1311
{"force", 'f', "Continue even if we get an sql error.",
1313
1312
(char**) &ignore_errors, (char**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
1315
1314
{"named-commands", 'G',
1316
N_("Enable named commands. Named commands mean this program's internal commands; see drizzle> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default."),
1315
"Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.",
1317
1316
(char**) &named_cmds, (char**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
1319
1318
{"no-named-commands", 'g',
1320
N_("Named commands are disabled. Use \\* form only, or use named commands only in the beginning of a line ending with a semicolon (;) Since version 10.9 the client now starts with this option ENABLED by default! Disable with '-G'. Long format commands still work from the first line. WARNING: option deprecated; use --disable-named-commands instead."),
1319
"Named commands are disabled. Use \\* form only, or use named commands only in the beginning of a line ending with a semicolon (;) Since version 10.9 the client now starts with this option ENABLED by default! Disable with '-G'. Long format commands still work from the first line. WARNING: option deprecated; use --disable-named-commands instead.",
1321
1320
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1322
{"ignore-spaces", 'i', N_("Ignore space after function names."), 0, 0, 0,
1321
{"ignore-spaces", 'i', "Ignore space after function names.", 0, 0, 0,
1323
1322
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1324
{"local-infile", OPT_LOCAL_INFILE, N_("Enable/disable LOAD DATA LOCAL INFILE."),
1323
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
1325
1324
(char**) &opt_local_infile,
1326
1325
(char**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
1327
{"no-beep", 'b', N_("Turn off beep on error."), (char**) &opt_nobeep,
1326
{"no-beep", 'b', "Turn off beep on error.", (char**) &opt_nobeep,
1328
1327
(char**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1329
{"host", 'h', N_("Connect to host."), (char**) ¤t_host,
1328
{"host", 'h', "Connect to host.", (char**) ¤t_host,
1330
1329
(char**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1331
{"line-numbers", OPT_LINE_NUMBERS, N_("Write line numbers for errors."),
1330
{"html", 'H', "Produce HTML output.", (char**) &opt_html, (char**) &opt_html,
1331
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1332
{"xml", 'X', "Produce XML output", (char**) &opt_xml, (char**) &opt_xml, 0,
1333
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1334
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
1332
1335
(char**) &line_numbers, (char**) &line_numbers, 0, GET_BOOL,
1333
1336
NO_ARG, 1, 0, 0, 0, 0, 0},
1334
{"skip-line-numbers", 'L', N_("Don't write line number for errors. WARNING: -L is deprecated, use long version of this option instead."), 0, 0, 0, GET_NO_ARG,
1337
{"skip-line-numbers", 'L', "Don't write line number for errors. WARNING: -L is deprecated, use long version of this option instead.", 0, 0, 0, GET_NO_ARG,
1335
1338
NO_ARG, 0, 0, 0, 0, 0, 0},
1336
{"unbuffered", 'n', N_("Flush buffer after each query."), (char**) &unbuffered,
1339
{"unbuffered", 'n', "Flush buffer after each query.", (char**) &unbuffered,
1337
1340
(char**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1338
{"column-names", OPT_COLUMN_NAMES, N_("Write column names in results."),
1341
{"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
1339
1342
(char**) &column_names, (char**) &column_names, 0, GET_BOOL,
1340
1343
NO_ARG, 1, 0, 0, 0, 0, 0},
1341
1344
{"skip-column-names", 'N',
1342
N_("Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead."),
1345
"Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead.",
1343
1346
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1344
1347
{"set-variable", 'O',
1345
N_("Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value."),
1348
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
1346
1349
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1347
{"sigint-ignore", OPT_SIGINT_IGNORE, N_("Ignore SIGINT (CTRL-C)"),
1350
{"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C)",
1348
1351
(char**) &opt_sigint_ignore, (char**) &opt_sigint_ignore, 0, GET_BOOL,
1349
1352
NO_ARG, 0, 0, 0, 0, 0, 0},
1350
1353
{"one-database", 'o',
1351
N_("Only update the default database. This is useful for skipping updates to other database in the update log."),
1354
"Only update the default database. This is useful for skipping updates to other database in the update log.",
1352
1355
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1353
1356
{"pager", OPT_PAGER,
1354
N_("Pager to use to display results. If you don't supply an option the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default."),
1357
"Pager to use to display results. If you don't supply an option the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.",
1355
1358
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
1356
1359
{"no-pager", OPT_NOPAGER,
1357
N_("Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead."),
1360
"Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.",
1358
1361
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1359
1362
{"password", 'p',
1360
N_("Password to use when connecting to server. If password is not given it's asked from the tty."),
1363
"Password to use when connecting to server. If password is not given it's asked from the tty.",
1361
1364
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
1362
{"port", 'P', N_("Port number to use for connection or 0 for default to, in order of preference, my.cnf, $DRIZZLE_TCP_PORT, ")
1363
N_("built-in default") " (" STRINGIFY_ARG(DRIZZLE_PORT) ").",
1364
(char**) &opt_drizzle_port,
1365
(char**) &opt_drizzle_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1366
{"prompt", OPT_PROMPT, N_("Set the drizzle prompt to this value."),
1365
{"port", 'P', "Port number to use for connection or 0 for default to, in "
1366
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
1367
#if MYSQL_PORT_DEFAULT == 0
1370
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
1371
(char**) &opt_mysql_port,
1372
(char**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1373
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
1367
1374
(char**) ¤t_prompt, (char**) ¤t_prompt, 0, GET_STR_ALLOC,
1368
1375
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1369
{"protocol", OPT_DRIZZLE_PROTOCOL, N_("The protocol of connection (tcp,socket,pipe,memory)."),
1376
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
1370
1377
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1372
N_("Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file."),
1379
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.",
1373
1380
(char**) &quick, (char**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1374
{"raw", 'r', N_("Write fields without conversion. Used with --batch."),
1381
{"raw", 'r', "Write fields without conversion. Used with --batch.",
1375
1382
(char**) &opt_raw_data, (char**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1377
{"reconnect", OPT_RECONNECT, N_("Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default."),
1384
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.",
1378
1385
(char**) &opt_reconnect, (char**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
1379
{"silent", 's', N_("Be more silent. Print results with a tab as separator, each row on new line."), 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
1386
{"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
1381
{"socket", 'S', N_("Socket file to use for connection."),
1382
(char**) &opt_drizzle_unix_port, (char**) &opt_drizzle_unix_port, 0, GET_STR_ALLOC,
1388
{"socket", 'S', "Socket file to use for connection.",
1389
(char**) &opt_mysql_unix_port, (char**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
1383
1390
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1384
{"table", 't', N_("Output in table format."), (char**) &output_tables,
1391
{"table", 't', "Output in table format.", (char**) &output_tables,
1385
1392
(char**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1386
1393
{"tee", OPT_TEE,
1387
N_("Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default."),
1394
"Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
1388
1395
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1389
{"no-tee", OPT_NOTEE, N_("Disable outfile. See interactive help (\\h) also. WARNING: option deprecated; use --disable-tee instead"), 0, 0, 0, GET_NO_ARG,
1396
{"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: option deprecated; use --disable-tee instead", 0, 0, 0, GET_NO_ARG,
1390
1397
NO_ARG, 0, 0, 0, 0, 0, 0},
1391
1398
#ifndef DONT_ALLOW_USER_CHANGE
1392
{"user", 'u', N_("User for login if not current user."), (char**) ¤t_user,
1399
{"user", 'u', "User for login if not current user.", (char**) ¤t_user,
1393
1400
(char**) ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1395
{"safe-updates", 'U', N_("Only allow UPDATE and DELETE that uses keys."),
1396
(char**) &safe_updates, (char**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1398
{"i-am-a-dummy", 'U', N_("Synonym for option --safe-updates, -U."),
1399
(char**) &safe_updates, (char**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1401
{"verbose", 'v', N_("Write more. (-v -v -v gives the table output format)."), 0,
1402
{"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
1403
(char**) &safe_updates, (char**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1405
{"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
1406
(char**) &safe_updates, (char**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1408
{"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
1402
1409
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1403
{"version", 'V', N_("Output version information and exit."), 0, 0, 0,
1410
{"version", 'V', "Output version information and exit.", 0, 0, 0,
1404
1411
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1405
{"wait", 'w', N_("Wait and retry if connection is down."), 0, 0, 0, GET_NO_ARG,
1412
{"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_NO_ARG,
1406
1413
NO_ARG, 0, 0, 0, 0, 0, 0},
1407
1414
{"connect_timeout", OPT_CONNECT_TIMEOUT,
1408
N_("Number of seconds before connection timeout."),
1415
"Number of seconds before connection timeout.",
1409
1416
(char**) &opt_connect_timeout,
1410
1417
(char**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
1412
1419
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
1413
N_("Max packet length to send to, or receive from server"),
1420
"Max packet length to send to, or receive from server",
1414
1421
(char**) &opt_max_allowed_packet, (char**) &opt_max_allowed_packet, 0,
1415
1422
GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
1416
1423
(int64_t) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
1417
1424
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
1418
N_("Buffer for TCP/IP and socket communication"),
1425
"Buffer for TCP/IP and socket communication",
1419
1426
(char**) &opt_net_buffer_length, (char**) &opt_net_buffer_length, 0, GET_ULONG,
1420
1427
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
1421
1428
{"select_limit", OPT_SELECT_LIMIT,
1422
N_("Automatic limit for SELECT when using --safe-updates"),
1429
"Automatic limit for SELECT when using --safe-updates",
1423
1430
(char**) &select_limit,
1424
1431
(char**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
1426
1433
{"max_join_size", OPT_MAX_JOIN_SIZE,
1427
N_("Automatic limit for rows in a join when using --safe-updates"),
1434
"Automatic limit for rows in a join when using --safe-updates",
1428
1435
(char**) &max_join_size,
1429
1436
(char**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
1431
{"secure-auth", OPT_SECURE_AUTH, N_("Refuse client connecting to server if it uses old (pre-4.1.1) protocol"), (char**) &opt_secure_auth,
1438
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
1439
" uses old (pre-4.1.1) protocol", (char**) &opt_secure_auth,
1432
1440
(char**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1433
{"show-warnings", OPT_SHOW_WARNINGS, N_("Show warnings after every statement."),
1441
{"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
1442
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1443
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
1434
1444
(char**) &show_warnings, (char**) &show_warnings, 0, GET_BOOL, NO_ARG,
1435
1445
0, 0, 0, 0, 0, 0},
1436
1446
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}