1298
1298
0, 0, 0, 0, 0},
1299
1299
{"auto-rehash", OPT_AUTO_REHASH,
1300
1300
"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.",
1301
(uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
1301
(char**) &opt_rehash, (char**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
1303
1303
{"no-auto-rehash", 'A',
1304
1304
"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.",
1305
1305
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1306
1306
{"auto-vertical-output", OPT_AUTO_VERTICAL_OUTPUT,
1307
1307
"Automatically switch to vertical output mode if the result is wider than the terminal width.",
1308
(uchar**) &auto_vertical_output, (uchar**) &auto_vertical_output, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1308
(char**) &auto_vertical_output, (char**) &auto_vertical_output, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1310
1310
"Don't use history file. Disable interactive behavior. (Enables --silent)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1311
1311
{"character-sets-dir", OPT_CHARSETS_DIR,
1312
"Directory where character sets are.", (uchar**) &charsets_dir,
1313
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1312
"Directory where character sets are.", (char**) &charsets_dir,
1313
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1314
1314
{"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
1315
(uchar**) &column_types_flag, (uchar**) &column_types_flag,
1315
(char**) &column_types_flag, (char**) &column_types_flag,
1316
1316
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1317
1317
{"comments", 'c', "Preserve comments. Send comments to the server."
1318
1318
" The default is --skip-comments (discard comments), enable with --comments",
1319
(uchar**) &preserve_comments, (uchar**) &preserve_comments,
1319
(char**) &preserve_comments, (char**) &preserve_comments,
1320
1320
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1321
1321
{"compress", 'C', "Use compression in server/client protocol.",
1322
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1322
(char**) &opt_compress, (char**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1325
1325
#ifdef DBUG_OFF
1326
1326
{"debug", '#', "This is a non-debug version. Catch this and exit",
1327
1327
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
1329
{"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
1330
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
1329
{"debug", '#', "Output debug log", (char**) &default_dbug_option,
1330
(char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
1332
1332
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
1333
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
1333
(char**) &debug_check_flag, (char**) &debug_check_flag, 0,
1334
1334
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1335
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
1336
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1337
{"database", 'D', "Database to use.", (uchar**) ¤t_db,
1338
(uchar**) ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1335
{"debug-info", 'T', "Print some debug info at exit.", (char**) &debug_info_flag,
1336
(char**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1337
{"database", 'D', "Database to use.", (char**) ¤t_db,
1338
(char**) ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1339
1339
{"default-character-set", OPT_DEFAULT_CHARSET,
1340
"Set the default character set.", (uchar**) &default_charset,
1341
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1342
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str,
1343
(uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1340
"Set the default character set.", (char**) &default_charset,
1341
(char**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1342
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (char**) &delimiter_str,
1343
(char**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1344
1344
{"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0,
1345
1345
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1346
1346
{"vertical", 'E', "Print the output of a query (rows) vertically.",
1347
(uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
1347
(char**) &vertical, (char**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
1349
1349
{"force", 'f', "Continue even if we get an sql error.",
1350
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
1350
(char**) &ignore_errors, (char**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
1352
1352
{"named-commands", 'G',
1353
1353
"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.",
1354
(uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
1354
(char**) &named_cmds, (char**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
1356
1356
{"no-named-commands", 'g',
1357
1357
"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.",
1359
1359
{"ignore-spaces", 'i', "Ignore space after function names.", 0, 0, 0,
1360
1360
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1361
1361
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
1362
(uchar**) &opt_local_infile,
1363
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
1364
{"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
1365
(uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1366
{"host", 'h', "Connect to host.", (uchar**) ¤t_host,
1367
(uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1368
{"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html,
1362
(char**) &opt_local_infile,
1363
(char**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
1364
{"no-beep", 'b', "Turn off beep on error.", (char**) &opt_nobeep,
1365
(char**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1366
{"host", 'h', "Connect to host.", (char**) ¤t_host,
1367
(char**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1368
{"html", 'H', "Produce HTML output.", (char**) &opt_html, (char**) &opt_html,
1369
1369
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1370
{"xml", 'X', "Produce XML output", (uchar**) &opt_xml, (uchar**) &opt_xml, 0,
1370
{"xml", 'X', "Produce XML output", (char**) &opt_xml, (char**) &opt_xml, 0,
1371
1371
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1372
1372
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
1373
(uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
1373
(char**) &line_numbers, (char**) &line_numbers, 0, GET_BOOL,
1374
1374
NO_ARG, 1, 0, 0, 0, 0, 0},
1375
1375
{"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,
1376
1376
NO_ARG, 0, 0, 0, 0, 0, 0},
1377
{"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
1378
(uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1377
{"unbuffered", 'n', "Flush buffer after each query.", (char**) &unbuffered,
1378
(char**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1379
1379
{"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
1380
(uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
1380
(char**) &column_names, (char**) &column_names, 0, GET_BOOL,
1381
1381
NO_ARG, 1, 0, 0, 0, 0, 0},
1382
1382
{"skip-column-names", 'N',
1383
1383
"Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead.",
1408
1408
"/etc/services, "
1410
1410
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
1411
(uchar**) &opt_mysql_port,
1412
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1411
(char**) &opt_mysql_port,
1412
(char**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1413
1413
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
1414
(uchar**) ¤t_prompt, (uchar**) ¤t_prompt, 0, GET_STR_ALLOC,
1414
(char**) ¤t_prompt, (char**) ¤t_prompt, 0, GET_STR_ALLOC,
1415
1415
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1416
1416
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
1417
1417
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1419
1419
"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.",
1420
(uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1420
(char**) &quick, (char**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1421
1421
{"raw", 'r', "Write fields without conversion. Used with --batch.",
1422
(uchar**) &opt_raw_data, (uchar**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1422
(char**) &opt_raw_data, (char**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
1424
1424
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.",
1425
(uchar**) &opt_reconnect, (uchar**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
1425
(char**) &opt_reconnect, (char**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
1426
1426
{"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,
1428
1428
#ifdef HAVE_SMEM
1429
1429
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
1430
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
1430
"Base name of shared memory.", (char**) &shared_memory_base_name, (char**) &shared_memory_base_name,
1431
1431
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1433
1433
{"socket", 'S', "Socket file to use for connection.",
1434
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
1434
(char**) &opt_mysql_unix_port, (char**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
1435
1435
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1436
{"table", 't', "Output in table format.", (uchar**) &output_tables,
1437
(uchar**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1436
{"table", 't', "Output in table format.", (char**) &output_tables,
1437
(char**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1438
1438
{"tee", OPT_TEE,
1439
1439
"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.",
1440
1440
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1441
1441
{"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: option deprecated; use --disable-tee instead", 0, 0, 0, GET_NO_ARG,
1442
1442
NO_ARG, 0, 0, 0, 0, 0, 0},
1443
1443
#ifndef DONT_ALLOW_USER_CHANGE
1444
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
1445
(uchar**) ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1444
{"user", 'u', "User for login if not current user.", (char**) ¤t_user,
1445
(char**) ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1447
1447
{"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
1448
(uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1448
(char**) &safe_updates, (char**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1450
1450
{"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
1451
(uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1451
(char**) &safe_updates, (char**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
1453
1453
{"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
1454
1454
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
1458
1458
NO_ARG, 0, 0, 0, 0, 0, 0},
1459
1459
{"connect_timeout", OPT_CONNECT_TIMEOUT,
1460
1460
"Number of seconds before connection timeout.",
1461
(uchar**) &opt_connect_timeout,
1462
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
1461
(char**) &opt_connect_timeout,
1462
(char**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
1464
1464
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
1465
1465
"Max packet length to send to, or receive from server",
1466
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
1466
(char**) &opt_max_allowed_packet, (char**) &opt_max_allowed_packet, 0,
1467
1467
GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
1468
1468
(longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
1469
1469
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
1470
1470
"Buffer for TCP/IP and socket communication",
1471
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG,
1471
(char**) &opt_net_buffer_length, (char**) &opt_net_buffer_length, 0, GET_ULONG,
1472
1472
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
1473
1473
{"select_limit", OPT_SELECT_LIMIT,
1474
1474
"Automatic limit for SELECT when using --safe-updates",
1475
(uchar**) &select_limit,
1476
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
1475
(char**) &select_limit,
1476
(char**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
1478
1478
{"max_join_size", OPT_MAX_JOIN_SIZE,
1479
1479
"Automatic limit for rows in a join when using --safe-updates",
1480
(uchar**) &max_join_size,
1481
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
1480
(char**) &max_join_size,
1481
(char**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
1483
1483
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
1484
" uses old (pre-4.1.1) protocol", (uchar**) &opt_secure_auth,
1485
(uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1484
" uses old (pre-4.1.1) protocol", (char**) &opt_secure_auth,
1485
(char**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
1486
1486
{"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
1487
1487
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1488
1488
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
1489
(uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG,
1489
(char**) &show_warnings, (char**) &show_warnings, 0, GET_BOOL, NO_ARG,
1490
1490
0, 0, 0, 0, 0, 0},
1491
1491
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}