summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorDaniel Fischer <df@sun.com>2010-04-21 14:58:09 +0200
committerDaniel Fischer <df@sun.com>2010-04-21 14:58:09 +0200
commit50edf454b14a5094603688b4eaf1c50ed280ba90 (patch)
tree4fad82e285f056995b626f0a62b5fa0488294c19 /client
parent7fcf60b80e66b6a7c037d89e3b266b7a9d68bc48 (diff)
parentc6c992e1cb817401f5a09fd7f6cf4eaebf448fab (diff)
downloadmariadb-git-50edf454b14a5094603688b4eaf1c50ed280ba90.tar.gz
Merge
Diffstat (limited to 'client')
-rw-r--r--client/Makefile.am3
-rw-r--r--client/client_priv.h8
-rw-r--r--client/mysql.cc64
-rw-r--r--client/mysql_upgrade.c22
-rw-r--r--client/mysqladmin.cc17
-rw-r--r--client/mysqlbinlog.cc25
-rw-r--r--client/mysqlcheck.c22
-rw-r--r--client/mysqldump.c114
-rw-r--r--client/mysqlimport.c33
-rw-r--r--client/mysqlshow.c27
-rw-r--r--client/mysqlslap.c12
-rw-r--r--client/mysqltest.cc317
12 files changed, 409 insertions, 255 deletions
diff --git a/client/Makefile.am b/client/Makefile.am
index eff1339fac5..1cd85c5840a 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -107,8 +107,9 @@ sql_src=log_event.h mysql_priv.h rpl_constants.h \
rpl_tblmap.h rpl_tblmap.cc \
log_event.cc my_decimal.h my_decimal.cc \
log_event_old.h log_event_old.cc \
+ rpl_record_old.h rpl_record_old.cc \
rpl_utility.h rpl_utility.cc \
- rpl_record_old.h rpl_record_old.cc
+ transaction.h
strings_src=decimal.c dtoa.c
link_sources:
diff --git a/client/client_priv.h b/client/client_priv.h
index 9cd151f6160..799f6aaec2f 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -34,7 +34,7 @@
enum options_client
{
OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
- OPT_PAGER, OPT_NOPAGER, OPT_TEE, OPT_NOTEE,
+ OPT_PAGER, OPT_TEE,
OPT_LOW_PRIORITY, OPT_AUTO_REPAIR, OPT_COMPRESS,
OPT_DROP, OPT_LOCKS, OPT_KEYWORDS, OPT_DELAYED, OPT_OPTIMIZE,
OPT_FTB, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC, OPT_TABLES,
@@ -48,8 +48,8 @@ enum options_client
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
- OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_SERVER_ARG,
- OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
+ OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG,
+ OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
#ifdef HAVE_NDBCLUSTER_DB
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
@@ -101,7 +101,7 @@ enum options_client
/**
First mysql version supporting the performance schema.
*/
-#define FIRST_PERFORMANCE_SCHEMA_VERSION 50599
+#define FIRST_PERFORMANCE_SCHEMA_VERSION 50503
/**
Name of the performance schema database.
diff --git a/client/mysql.cc b/client/mysql.cc
index 1a03034a30c..9cb1ecd3c21 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -457,7 +457,6 @@ static COMMANDS commands[] = {
{ "FORCE", 0, 0, 0, ""},
{ "FOREIGN", 0, 0, 0, ""},
{ "FOUND", 0, 0, 0, ""},
- { "FRAC_SECOND", 0, 0, 0, ""},
{ "FROM", 0, 0, 0, ""},
{ "FULL", 0, 0, 0, ""},
{ "FULLTEXT", 0, 0, 0, ""},
@@ -702,7 +701,6 @@ static COMMANDS commands[] = {
{ "SQL_NO_CACHE", 0, 0, 0, ""},
{ "SQL_SMALL_RESULT", 0, 0, 0, ""},
{ "SQL_THREAD", 0, 0, 0, ""},
- { "SQL_TSI_FRAC_SECOND", 0, 0, 0, ""},
{ "SQL_TSI_SECOND", 0, 0, 0, ""},
{ "SQL_TSI_MINUTE", 0, 0, 0, ""},
{ "SQL_TSI_HOUR", 0, 0, 0, ""},
@@ -1365,7 +1363,7 @@ static struct my_option my_long_options[] =
{"help", 'I', "Synonym for -?", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
#ifdef __NETWARE__
- {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
+ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"auto-rehash", OPT_AUTO_REHASH,
@@ -1373,21 +1371,21 @@ static struct my_option my_long_options[] =
(uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
0, 0},
{"no-auto-rehash", 'A',
- "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.",
+ "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.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"auto-vertical-output", OPT_AUTO_VERTICAL_OUTPUT,
"Automatically switch to vertical output mode if the result is wider than the terminal width.",
(uchar**) &auto_vertical_output, (uchar**) &auto_vertical_output, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"batch", 'B',
- "Don't use history file. Disable interactive behavior. (Enables --silent)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ "Don't use history file. Disable interactive behavior. (Enables --silent.)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &charsets_dir,
+ "Directory for character set files.", (uchar**) &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
(uchar**) &column_types_flag, (uchar**) &column_types_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"comments", 'c', "Preserve comments. Send comments to the server."
- " The default is --skip-comments (discard comments), enable with --comments",
+ " The default is --skip-comments (discard comments), enable with --comments.",
(uchar**) &preserve_comments, (uchar**) &preserve_comments,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
@@ -1395,10 +1393,10 @@ static struct my_option my_long_options[] =
0, 0, 0},
#ifdef DBUG_OFF
- {"debug", '#', "This is a non-debug version. Catch this and exit",
+ {"debug", '#', "This is a non-debug version. Catch this and exit.",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
@@ -1413,21 +1411,18 @@ static struct my_option my_long_options[] =
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str,
(uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"execute", 'e', "Execute command and quit. (Disables --force and history file)", 0,
+ {"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"vertical", 'E', "Print the output of a query (rows) vertically.",
(uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
- {"force", 'f', "Continue even if we get an sql error.",
+ {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"named-commands", 'G',
"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.",
(uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"no-named-commands", 'g',
- "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.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"ignore-spaces", 'i', "Ignore space after function names.",
(uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
@@ -1444,12 +1439,12 @@ static struct my_option my_long_options[] =
(uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"xml", 'X', "Produce XML output", (uchar**) &opt_xml, (uchar**) &opt_xml, 0,
+ {"xml", 'X', "Produce XML output.", (uchar**) &opt_xml, (uchar**) &opt_xml, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
(uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
- {"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,
+ {"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
(uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -1457,12 +1452,9 @@ static struct my_option my_long_options[] =
(uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-column-names", 'N',
- "Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead.",
+ "Don't write column names in results.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"set-variable", 'O',
- "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C)",
+ {"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C).",
(uchar**) &opt_sigint_ignore, (uchar**) &opt_sigint_ignore, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"one-database", 'o',
@@ -1470,11 +1462,8 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef USE_POPEN
{"pager", OPT_PAGER,
- "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.",
+ "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.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
- {"no-pager", OPT_NOPAGER,
- "Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
@@ -1494,7 +1483,7 @@ static struct my_option my_long_options[] =
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
(uchar**) &current_prompt, (uchar**) &current_prompt, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
+ {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q',
"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.",
@@ -1511,7 +1500,7 @@ static struct my_option my_long_options[] =
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h"
@@ -1520,8 +1509,6 @@ static struct my_option my_long_options[] =
{"tee", OPT_TEE,
"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.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: option deprecated; use --disable-tee instead", 0, 0, 0, GET_NO_ARG,
- NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (uchar**) &current_user,
(uchar**) &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -1544,26 +1531,26 @@ static struct my_option my_long_options[] =
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
0, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
- "Max packet length to send to, or receive from server",
+ "The maximum packet length to send to or receive from server.",
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
(longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
- "Buffer for TCP/IP and socket communication",
+ "The buffer size for TCP/IP and socket communication.",
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG,
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
{"select_limit", OPT_SELECT_LIMIT,
- "Automatic limit for SELECT when using --safe-updates",
+ "Automatic limit for SELECT when using --safe-updates.",
(uchar**) &select_limit,
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
0, 1, 0},
{"max_join_size", OPT_MAX_JOIN_SIZE,
- "Automatic limit for rows in a join when using --safe-updates",
+ "Automatic limit for rows in a join when using --safe-updates.",
(uchar**) &max_join_size,
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
0, 1, 0},
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
- " uses old (pre-4.1.1) protocol", (uchar**) &opt_secure_auth,
+ " uses old (pre-4.1.1) protocol.", (uchar**) &opt_secure_auth,
(uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -1660,11 +1647,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
else
init_tee(argument);
break;
- case OPT_NOTEE:
- printf("WARNING: option deprecated; use --disable-tee instead.\n");
- if (opt_outfile)
- end_tee();
- break;
case OPT_PAGER:
if (argument == disabled_my_option)
opt_nopager= 1;
@@ -1683,10 +1665,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_nopager= 1;
}
break;
- case OPT_NOPAGER:
- printf("WARNING: option deprecated; use --disable-pager instead.\n");
- opt_nopager= 1;
- break;
case OPT_MYSQL_PROTOCOL:
#ifndef EMBEDDED_LIBRARY
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 4c4820e69eb..4e2fc7019e5 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -63,21 +63,21 @@ static struct my_option my_long_options[]=
{
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"basedir", 'b', "Not used by mysql_upgrade. Only for backward compatibilty",
+ {"basedir", 'b', "Not used by mysql_upgrade. Only for backward compatibility.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", 0,
+ "Directory for character set files.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
(uchar**)&not_used, (uchar**)&not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"datadir", 'd',
- "Not used by mysql_upgrade. Only for backward compatibilty",
+ "Not used by mysql_upgrade. Only for backward compatibility.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
- {"debug", '#', "This is a non-debug version. Catch this and exit",
+ {"debug", '#', "This is a non-debug version. Catch this and exit.",
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (uchar* *) & default_dbug_option,
+ {"debug", '#', "Output debug log.", (uchar* *) & default_dbug_option,
(uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
@@ -95,7 +95,7 @@ static struct my_option my_long_options[]=
{"host",'h', "Connect to host.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
- "Password to use when connecting to server. If password is not given"
+ "Password to use when connecting to server. If password is not given,"
" it's solicited on the tty.", (uchar**) &opt_password,(uchar**) &opt_password,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __WIN__
@@ -110,17 +110,17 @@ static struct my_option my_long_options[]=
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL,
- "The protocol of connection (tcp,socket,pipe,memory).",
+ "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
- {"tmpdir", 't', "Directory for temporary files",
+ {"tmpdir", 't', "Directory for temporary files.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"upgrade-system-tables", 's', "Only upgrade the system tables "
"do not try to upgrade the data.",
@@ -128,7 +128,7 @@ static struct my_option my_long_options[]=
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
(uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Display more output about the process",
+ {"verbose", 'v', "Display more output about the process.",
(uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG,
@@ -233,7 +233,7 @@ get_one_option(int optid, const struct my_option *opt,
case '?':
printf("%s Ver %s Distrib %s, for %s (%s)\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
- puts("MySQL utility for upgrading databases to new MySQL versions\n");
+ puts("MySQL utility for upgrading databases to new MySQL versions.\n");
my_print_help(my_long_options);
exit(0);
break;
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 2c4a20f2786..b021c0f155e 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -117,7 +117,7 @@ static TYPELIB command_typelib=
static struct my_option my_long_options[] =
{
#ifdef __NETWARE__
- {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
+ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"count", 'c',
@@ -128,7 +128,7 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
+ {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
@@ -142,7 +142,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &charsets_dir,
+ "Directory for character set files.", (uchar**) &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset,
@@ -168,15 +168,12 @@ static struct my_option my_long_options[] =
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &tcp_port,
(uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
+ {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relative", 'r',
- "Show difference between current and previous values when used with -i. Currently works only with extended-status.",
+ "Show difference between current and previous values when used with -i. Currently only works with extended-status.",
(uchar**) &opt_relative, (uchar**) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
- {"set-variable", 'O',
- "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
@@ -184,10 +181,10 @@ static struct my_option my_long_options[] =
#endif
{"silent", 's', "Silently exit if one can't connect to server.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &unix_port, (uchar**) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
- {"sleep", 'i', "Execute commands again and again with a sleep between.",
+ {"sleep", 'i', "Execute commands repeatedly with a sleep between.",
(uchar**) &interval, (uchar**) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
#include <sslopt-longopts.h>
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index dae6b36eeb2..537567cbe4e 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1005,7 +1005,7 @@ static struct my_option my_long_options[] =
{"help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
- {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
+ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"base64-output", OPT_BASE64_OUTPUT_MODE,
@@ -1029,7 +1029,7 @@ static struct my_option my_long_options[] =
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
*/
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &charsets_dir,
+ "Directory for character set files.", (uchar**) &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'd', "List entries for just this database (local log only).",
(uchar**) &database, (uchar**) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
@@ -1077,15 +1077,10 @@ static struct my_option my_long_options[] =
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
- {"position", 'j', "Deprecated. Use --start-position instead.",
- (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
- REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
- /* COM_BINLOG_DUMP accepts only 4 bytes for the position */
- (ulonglong)(~(uint32)0), 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL,
- "The protocol of connection (tcp,socket,pipe,memory).",
+ "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"read-from-remote-server", 'R', "Read binary logs from a MySQL server",
+ {"read-from-remote-server", 'R', "Read binary logs from a MySQL server.",
(uchar**) &remote_opt, (uchar**) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
@@ -1109,7 +1104,7 @@ static struct my_option my_long_options[] =
"using --base64-output=never instead.",
(uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &sock, (uchar**) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"start-datetime", OPT_START_DATETIME,
@@ -1120,7 +1115,7 @@ static struct my_option my_long_options[] =
"(you should probably use quotes for your shell to set it properly).",
(uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"start-position", OPT_START_POSITION,
+ {"start-position", 'j',
"Start reading the binlog at position N. Applies to the first binlog "
"passed on the command line.",
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
@@ -1151,12 +1146,12 @@ that may lead to an endless loop.",
(uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"verbose", 'v', "Reconstruct SQL statements out of row events. "
- "-v -v adds comments on column data types",
+ "-v -v adds comments on column data types.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
- "Used to reserve file descriptors for usage by this program",
+ "Used to reserve file descriptors for use by this program.",
(uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -1255,11 +1250,11 @@ static void usage()
print_version();
puts("By Monty and Sasha, for your professional use\n\
This software comes with NO WARRANTY: This is free software,\n\
-and you are welcome to modify and redistribute it under the GPL license\n");
+and you are welcome to modify and redistribute it under the GPL license.\n");
printf("\
Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
-the mysql command line client\n\n");
+the mysql command line client.\n\n");
printf("Usage: %s [options] log-files\n", my_progname);
my_print_help(my_long_options);
my_print_variables(my_long_options);
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 57fa5b6a0f1..183ceb2d7f4 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -53,7 +53,7 @@ enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
static struct my_option my_long_options[] =
{
{"all-databases", 'A',
- "Check all the databases. This will be same as --databases with all databases selected.",
+ "Check all the databases. This is the same as --databases with all databases selected.",
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
@@ -63,7 +63,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#ifdef __NETWARE__
- {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
+ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"auto-repair", OPT_AUTO_REPAIR,
@@ -71,7 +71,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &charsets_dir,
+ "Directory for character set files.", (uchar**) &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
@@ -85,7 +85,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"databases", 'B',
- "To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.",
+ "Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.",
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
@@ -113,7 +113,7 @@ static struct my_option my_long_options[] =
{"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
(uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"force", 'f', "Continue even if we get an sql-error.",
+ {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"extended", 'e',
@@ -134,7 +134,7 @@ static struct my_option my_long_options[] =
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
0, 0},
{"password", 'p',
- "Password to use when connecting to server. If password is not given it's solicited on the tty.",
+ "Password to use when connecting to server. If password is not given, it's solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __WIN__
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
@@ -149,7 +149,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
- {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
+ {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q',
"If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
@@ -165,7 +165,7 @@ static struct my_option my_long_options[] =
#endif
{"silent", 's', "Print only error messages.", (uchar**) &opt_silent,
(uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
@@ -221,14 +221,14 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("By Jani Tolonen, 2001-04-20, MySQL Development Team\n");
+ puts("By Jani Tolonen, 2001-04-20, MySQL Development Team.\n");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n");
puts("and you are welcome to modify and redistribute it under the GPL license.\n");
- puts("This program can be used to CHECK (-c,-m,-C), REPAIR (-r), ANALYZE (-a)");
+ puts("This program can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a),");
puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be");
puts("used at the same time. Not all options are supported by all storage engines.");
puts("Please consult the MySQL manual for latest information about the");
- puts("above. The options -c,-r,-a and -o are exclusive to each other, which");
+ puts("above. The options -c, -r, -a, and -o are exclusive to each other, which");
puts("means that the last option will be used, if several was specified.\n");
puts("The option -c will be used by default, if none was specified. You");
puts("can change the default behavior by making a symbolic link, or");
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 3f4ce1ab0af..5b12e711331 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -184,9 +184,6 @@ HASH ignore_table;
static struct my_option my_long_options[] =
{
- {"all", 'a', "Deprecated. Use --create-options instead.",
- (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
- 0, 0, 0, 0, 0},
{"all-databases", 'A',
"Dump all the databases. This will be same as --databases with all databases selected.",
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
@@ -199,13 +196,13 @@ static struct my_option my_long_options[] =
"Do not dump any tablespace information.",
(uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"add-drop-database", OPT_DROP_DATABASE, "Add a 'DROP DATABASE' before each create.",
+ {"add-drop-database", OPT_DROP_DATABASE, "Add a DROP DATABASE before each create.",
(uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
- {"add-drop-table", OPT_DROP, "Add a 'drop table' before each create.",
+ {"add-drop-table", OPT_DROP, "Add a DROP TABLE before each create.",
(uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
- {"add-locks", OPT_LOCKS, "Add locks around insert statements.",
+ {"add-locks", OPT_LOCKS, "Add locks around INSERT statements.",
(uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
{"allow-keywords", OPT_KEYWORDS,
@@ -216,11 +213,11 @@ static struct my_option my_long_options[] =
(uchar**) &opt_slave_apply, (uchar**) &opt_slave_apply, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
- {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
+ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &charsets_dir,
+ "Directory for character set files.", (uchar**) &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"comments", 'i', "Write additional information.",
(uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG,
@@ -230,7 +227,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compact", OPT_COMPACT,
- "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset",
+ "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset.",
(uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"complete-insert", 'c', "Use complete insert statements.",
@@ -239,19 +236,19 @@ static struct my_option my_long_options[] =
{"compress", 'C', "Use compression in server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
- {"create-options", OPT_CREATE_OPTIONS,
+ {"create-options", 'a',
"Include all MySQL specific create options.",
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
{"databases", 'B',
- "To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output.",
+ "Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.",
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
#ifdef DBUG_OFF
- {"debug", '#', "This is a non-debug version. Catch this and exit",
+ {"debug", '#', "This is a non-debug version. Catch this and exit.",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
+ {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
@@ -263,7 +260,7 @@ static struct my_option my_long_options[] =
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; ",
+ {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.",
(uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"delete-master-logs", OPT_DELETE_MASTER_LOGS,
@@ -294,19 +291,21 @@ static struct my_option my_long_options[] =
(uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
- "Fields in the textfile are terminated by ...", (uchar**) &fields_terminated,
- (uchar**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Fields in the output file are terminated by the given string.",
+ (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-enclosed-by", OPT_ENC,
- "Fields in the importfile are enclosed by ...", (uchar**) &enclosed,
- (uchar**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
+ "Fields in the output file are enclosed by the given character.",
+ (uchar**) &enclosed, (uchar**) &enclosed, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
{"fields-optionally-enclosed-by", OPT_O_ENC,
- "Fields in the i.file are opt. enclosed by ...", (uchar**) &opt_enclosed,
- (uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
- {"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
- (uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"first-slave", 'x', "Deprecated, renamed to --lock-all-tables.",
- (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
- 0, 0, 0, 0, 0, 0},
+ "Fields in the output file are optionally enclosed by the given character.",
+ (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
+ {"fields-escaped-by", OPT_ESC,
+ "Fields in the output file are escaped by the given character.",
+ (uchar**) &escaped, (uchar**) &escaped, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
"Note that if you dump many databases at once (using the option "
"--databases= or --all-databases), the logs will be flushed for "
@@ -315,7 +314,7 @@ static struct my_option my_long_options[] =
"in this case the logs will be flushed only once, corresponding "
"to the moment all tables are locked. So if you want your dump and "
"the log flush to happen at the same exact moment you should use "
- "--lock-all-tables or --master-data with --flush-logs",
+ "--lock-all-tables or --master-data with --flush-logs.",
(uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
@@ -324,7 +323,7 @@ static struct my_option my_long_options[] =
"that depends on the data in the mysql database for proper restore. ",
(uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"force", 'f', "Continue even if we get an sql-error.",
+ {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
@@ -337,7 +336,8 @@ static struct my_option my_long_options[] =
{"ignore-table", OPT_IGNORE_TABLE,
"Do not dump the specified table. To specify more than one table to ignore, "
"use the directive multiple times, once for each table. Each table must "
- "be specified with both database and table names, e.g. --ignore-table=database.table",
+ "be specified with both database and table names, e.g., "
+ "--ignore-table=database.table.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"include-master-host-port", OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,
"Adds 'MASTER_HOST=<host>, MASTER_PORT=<port>' to 'CHANGE MASTER TO..' in dump produced with --dump-slave.",
@@ -348,7 +348,8 @@ static struct my_option my_long_options[] =
{"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
(uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
- {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
+ {"lines-terminated-by", OPT_LTB,
+ "Lines in the output file are terminated by the given string.",
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"lock-all-tables", 'x', "Locks all tables across all databases. This "
@@ -367,17 +368,19 @@ static struct my_option my_long_options[] =
" to 2, that command will be prefixed with a comment symbol. "
"This option will turn --lock-all-tables on, unless "
"--single-transaction is specified too (in which case a "
- "global read lock is only taken a short time at the beginning of the dump "
- "- don't forget to read about --single-transaction below). In all cases "
- "any action on logs will happen at the exact moment of the dump."
+ "global read lock is only taken a short time at the beginning of the dump; "
+ "don't forget to read about --single-transaction below). In all cases, "
+ "any action on logs will happen at the exact moment of the dump. "
"Option automatically turns --lock-tables off.",
(uchar**) &opt_master_data, (uchar**) &opt_master_data, 0,
GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
- {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
+ {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
+ "The maximum packet length to send to or receive from server.",
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
(longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
- {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
+ {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
+ "The buffer size for TCP/IP and socket communication.",
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0,
GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
MALLOC_OVERHEAD-1024, 1024, 0},
@@ -386,16 +389,17 @@ static struct my_option my_long_options[] =
(uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"no-create-db", 'n',
- "'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}.",
- (uchar**) &opt_create_db, (uchar**) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
- 0, 0, 0, 0},
+ "Suppress the CREATE DATABASE ... IF EXISTS statement that normally is "
+ "output for each dumped database if --all-databases or --databases is "
+ "given.",
+ (uchar**) &opt_create_db, (uchar**) &opt_create_db, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-create-info", 't', "Don't write table creation info.",
(uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
(uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"no-set-names", 'N',
- "Deprecated. Use --skip-set-charset instead.",
+ {"no-set-names", 'N', "Same as--skip-set-charset.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"opt", OPT_OPTIMIZE,
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
@@ -413,8 +417,9 @@ static struct my_option my_long_options[] =
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
- {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"protocol", OPT_MYSQL_PROTOCOL,
+ "The protocol to use for connection (tcp, socket, pipe, memory).",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q', "Don't buffer query, dump directly to stdout.",
(uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"quote-names",'Q', "Quote table and column names with backticks (`).",
@@ -433,9 +438,6 @@ static struct my_option my_long_options[] =
"Add 'SET NAMES default_character_set' to the output.",
(uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
- {"set-variable", 'O',
- "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
@@ -464,18 +466,20 @@ static struct my_option my_long_options[] =
{"skip-opt", OPT_SKIP_OPTIMIZATION,
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection.",
- (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
- REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"socket", 'S', "The socket file to use for connection.",
+ (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
{"tab",'T',
- "Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.",
+ "Create tab-separated textfile for each table to given path. (Create .sql "
+ "and .txt files.) NOTE: This only works if mysqldump is run on the same "
+ "machine as the mysqld server.",
(uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tables", OPT_TABLES, "Overrides option --databases (-B).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table",
- (uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL,
- NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table.",
+ (uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL,
+ NO_ARG, 1, 0, 0, 0, 0, 0},
{"tz-utc", OPT_TZ_UTC,
"SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
(uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
@@ -488,7 +492,7 @@ static struct my_option my_long_options[] =
(uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version",'V', "Output version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"where", 'w', "Dump only selected records; QUOTES mandatory!",
+ {"where", 'w', "Dump only selected records. Quotes are mandatory.",
(uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -582,9 +586,9 @@ static void short_usage_sub(void)
static void usage(void)
{
print_version();
- puts("By Igor Romanenko, Monty, Jani & Sinisa");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
- puts("Dumping definition and data mysql database or table");
+ puts("By Igor Romanenko, Monty, Jani & Sinisa.");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
+ puts("Dumping structure and contents of MySQL databases and tables.");
short_usage_sub();
print_defaults("my",load_default_groups);
my_print_help(my_long_options);
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index f8432c95548..b25469b1955 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -68,11 +68,11 @@ static char *shared_memory_base_name=0;
static struct my_option my_long_options[] =
{
#ifdef __NETWARE__
- {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
+ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &charsets_dir,
+ "Directory for character set files.", (uchar**) &charsets_dir,
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset,
@@ -95,18 +95,22 @@ static struct my_option my_long_options[] =
{"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete,
(uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
- "Fields in the textfile are terminated by ...", (uchar**) &fields_terminated,
- (uchar**) &fields_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Fields in the input file are terminated by the given string.",
+ (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-enclosed-by", OPT_ENC,
- "Fields in the importfile are enclosed by ...", (uchar**) &enclosed,
- (uchar**) &enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Fields in the import file are enclosed by the given character.",
+ (uchar**) &enclosed, (uchar**) &enclosed, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fields-optionally-enclosed-by", OPT_O_ENC,
- "Fields in the i.file are opt. enclosed by ...", (uchar**) &opt_enclosed,
- (uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
+ "Fields in the input file are optionally enclosed by the given character.",
+ (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"fields-escaped-by", OPT_ESC,
+ "Fields in the input file are escaped by the given character.",
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
- {"force", 'f', "Continue even if we get an sql-error.",
+ {"force", 'f', "Continue even if we get an SQL error.",
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG,
@@ -118,7 +122,8 @@ static struct my_option my_long_options[] =
{"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
(uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
+ {"lines-terminated-by", OPT_LTB,
+ "Lines in the input file are terminated by the given string.",
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file,
@@ -145,7 +150,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_mysql_port,
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
0},
- {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
+ {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replace", 'r', "If duplicate unique key was found, replace old row.",
(uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -156,7 +161,7 @@ static struct my_option my_long_options[] =
#endif
{"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
@@ -193,7 +198,7 @@ static void usage(void)
{
print_version();
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
printf("\
Loads tables from text files in various formats. The base name of the\n\
text file must be the name of the table that should be used.\n\
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 588ee049546..36bf974158a 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -162,17 +162,17 @@ int main(int argc, char **argv)
static struct my_option my_long_options[] =
{
#ifdef __NETWARE__
- {"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
+ {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"character-sets-dir", 'c', "Directory where character sets are.",
+ {"character-sets-dir", 'c', "Directory for character set files.",
(uchar**) &charsets_dir, (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (uchar**) &default_charset,
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"count", OPT_COUNT,
- "Show number of rows per table (may be slow for not MyISAM tables)",
+ "Show number of rows per table (may be slow for non-MyISAM tables).",
(uchar**) &opt_count, (uchar**) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
@@ -196,7 +196,8 @@ static struct my_option my_long_options[] =
{"keys", 'k', "Show keys for table.", (uchar**) &opt_show_keys,
(uchar**) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
- "Password to use when connecting to server. If password is not given it's asked from the tty.",
+ "Password to use when connecting to server. If password is not given, it's "
+ "solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
@@ -211,7 +212,8 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
+ {"protocol", OPT_MYSQL_PROTOCOL,
+ "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
@@ -221,7 +223,7 @@ static struct my_option my_long_options[] =
{"show-table-type", 't', "Show table type column.",
(uchar**) &opt_table_type, (uchar**) &opt_table_type, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
@@ -230,7 +232,8 @@ static struct my_option my_long_options[] =
(uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v',
- "More verbose output; You can use this multiple times to get even more verbose output.",
+ "More verbose output; you can use this multiple times to get even more "
+ "verbose output.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -252,16 +255,16 @@ static void usage(void)
{
print_version();
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
- puts("Shows the structure of a mysql database (databases,tables and columns)\n");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
+ puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
puts("\n\
If last argument contains a shell or SQL wildcard (*,?,% or _) then only\n\
what\'s matched by the wildcard is shown.\n\
If no database is given then all matching databases are shown.\n\
-If no table is given then all matching tables in database are shown\n\
-If no column is given then all matching columns and columntypes in table\n\
-are shown");
+If no table is given, then all matching tables in database are shown.\n\
+If no column is given, then all matching columns and column types in table\n\
+are shown.");
print_defaults("my",load_default_groups);
my_print_help(my_long_options);
my_print_variables(my_long_options);
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 6ff2a868a21..0779b7a45e0 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -616,8 +616,8 @@ static struct my_option my_long_options[] =
(uchar**) &num_of_query, (uchar**) &num_of_query, 0,
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"only-print", OPT_MYSQL_ONLY_PRINT,
- "This causes mysqlslap to not connect to the databases, but instead print "
- "out what it would have done instead.",
+ "Do not connect to the databases, but instead print out what would have "
+ "been done.",
(uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"password", 'p',
@@ -651,7 +651,7 @@ static struct my_option my_long_options[] =
(uchar**) &pre_system,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL,
- "The protocol of connection (tcp,socket,pipe,memory).",
+ "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"query", 'q', "Query to run or file containing query to run.",
(uchar**) &user_supplied_query, (uchar**) &user_supplied_query,
@@ -665,7 +665,7 @@ static struct my_option my_long_options[] =
{"silent", 's', "Run program in silent mode - no output.",
(uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h>
@@ -696,8 +696,8 @@ static void usage(void)
{
print_version();
puts("Copyright (C) 2005 MySQL AB");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
- puts("Run a query multiple times against the server\n");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
+ puts("Run a query multiple times against the server.\n");
printf("Usage: %s [OPTIONS]\n",my_progname);
print_defaults("my",load_default_groups);
my_print_help(my_long_options);
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 9a977e2a521..186c32dbc89 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -67,6 +67,7 @@
#define MAX_COLUMNS 256
#define MAX_EMBEDDED_SERVER_ARGS 64
#define MAX_DELIMITER_LENGTH 16
+#define DEFAULT_MAX_CONN 128
/* Flags controlling send and reap */
#define QUERY_SEND_FLAG 1
@@ -79,8 +80,8 @@ static int setenv(const char *name, const char *value, int overwrite);
enum {
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
- OPT_MAX_CONNECT_RETRIES, OPT_MARK_PROGRESS, OPT_LOG_DIR, OPT_TAIL_LINES,
- OPT_RESULT_FORMAT_VERSION
+ OPT_MAX_CONNECT_RETRIES, OPT_MAX_CONNECTIONS, OPT_MARK_PROGRESS,
+ OPT_LOG_DIR, OPT_TAIL_LINES, OPT_RESULT_FORMAT_VERSION,
};
static int record= 0, opt_sleep= -1;
@@ -92,6 +93,7 @@ const char *opt_include= 0, *opt_charsets_dir;
static int opt_port= 0;
static int opt_max_connect_retries;
static int opt_result_format_version;
+static int opt_max_connections= DEFAULT_MAX_CONN;
static my_bool opt_compress= 0, silent= 0, verbose= 0;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static my_bool tty_password= 0;
@@ -101,7 +103,7 @@ static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
static my_bool view_protocol= 0, view_protocol_enabled= 0;
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
static my_bool parsing_disabled= 0;
-static my_bool display_result_vertically= FALSE,
+static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
display_metadata= FALSE, display_result_sorted= FALSE;
static my_bool disable_query_log= 0, disable_result_log= 0;
static my_bool disable_warnings= 0;
@@ -138,6 +140,7 @@ struct st_block
int line; /* Start line of block */
my_bool ok; /* Should block be executed */
enum block_cmd cmd; /* Command owning the block */
+ char delim[MAX_DELIMITER_LENGTH]; /* Delimiter before block */
};
static struct st_block block_stack[32];
@@ -233,6 +236,8 @@ struct st_connection
char *name;
size_t name_len;
MYSQL_STMT* stmt;
+ /* Set after send to disallow other queries before reap */
+ my_bool pending;
#ifdef EMBEDDED_LIBRARY
const char *cur_query;
@@ -242,7 +247,8 @@ struct st_connection
int query_done;
#endif /*EMBEDDED_LIBRARY*/
};
-struct st_connection connections[128];
+
+struct st_connection *connections= NULL;
struct st_connection* cur_con= NULL, *next_con, *connections_end;
/*
@@ -276,6 +282,7 @@ enum enum_commands {
Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_SORTED_RESULT,
+ Q_LOWERCASE,
Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
@@ -288,7 +295,7 @@ enum enum_commands {
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
Q_RESULT_FORMAT_VERSION,
- Q_MOVE_FILE, Q_SEND_EVAL,
+ Q_MOVE_FILE, Q_REMOVE_FILES_WILDCARD, Q_SEND_EVAL,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND,
@@ -348,6 +355,7 @@ const char *command_names[]=
"query_vertical",
"query_horizontal",
"sorted_result",
+ "lowercase_result",
"start_timer",
"end_timer",
"character_set",
@@ -384,6 +392,7 @@ const char *command_names[]=
"shutdown_server",
"result_format",
"move_file",
+ "remove_files_wildcard",
"send_eval",
0
@@ -488,6 +497,8 @@ void free_replace();
void do_get_replace_regex(struct st_command *command);
void free_replace_regex();
+/* Used by sleep */
+void check_eol_junk_line(const char *eol);
void free_all_replace(){
free_replace();
@@ -1034,7 +1045,7 @@ void check_command_args(struct st_command *command,
}
/* Check for too many arguments passed */
ptr= command->last_argument;
- while(ptr <= command->end)
+ while(ptr <= command->end && *ptr != '#')
{
if (*ptr && *ptr != ' ')
die("Extra argument '%s' passed to '%.*s'",
@@ -1092,6 +1103,7 @@ void close_connections()
mysql_close(next_con->util_mysql);
my_free(next_con->name, MYF(MY_ALLOW_ZERO_PTR));
}
+ my_free(connections, MYF(MY_WME));
DBUG_VOID_RETURN;
}
@@ -1118,7 +1130,7 @@ void close_files()
if (cur_file->file && cur_file->file != stdin)
{
DBUG_PRINT("info", ("closing file: %s", cur_file->file_name));
- my_fclose(cur_file->file, MYF(0));
+ fclose(cur_file->file);
}
my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
cur_file->file_name= 0;
@@ -1132,7 +1144,8 @@ void free_used_memory()
uint i;
DBUG_ENTER("free_used_memory");
- close_connections();
+ if (connections)
+ close_connections();
close_files();
my_hash_free(&var_hash);
@@ -2493,7 +2506,7 @@ int open_file(const char *name)
if (cur_file == file_stack_end)
die("Source directives are nesting too deep");
cur_file++;
- if (!(cur_file->file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
+ if (!(cur_file->file = fopen(buff, "rb")))
{
cur_file--;
die("Could not open '%s' for reading, errno: %d", buff, errno);
@@ -2705,6 +2718,10 @@ void do_exec(struct st_command *command)
#endif
#endif
+ /* exec command is interpreted externally and will not take newlines */
+ while(replace(&ds_cmd, "\n", 1, " ", 1) == 0)
+ ;
+
DBUG_PRINT("info", ("Executing '%s' as '%s'",
command->first_argument, ds_cmd.str));
@@ -2930,6 +2947,81 @@ void do_remove_file(struct st_command *command)
/*
SYNOPSIS
+ do_remove_files_wildcard
+ command called command
+
+ DESCRIPTION
+ remove_files_wildcard <directory> [<file_name_pattern>]
+ Remove the files in <directory> optionally matching <file_name_pattern>
+*/
+
+void do_remove_files_wildcard(struct st_command *command)
+{
+ int error= 0;
+ uint i;
+ MY_DIR *dir_info;
+ FILEINFO *file;
+ char dir_separator[2];
+ static DYNAMIC_STRING ds_directory;
+ static DYNAMIC_STRING ds_wild;
+ static DYNAMIC_STRING ds_file_to_remove;
+ char dirname[FN_REFLEN];
+
+ const struct command_arg rm_args[] = {
+ { "directory", ARG_STRING, TRUE, &ds_directory,
+ "Directory containing files to delete" },
+ { "filename", ARG_STRING, FALSE, &ds_wild, "File pattern to delete" }
+ };
+ DBUG_ENTER("do_remove_files_wildcard");
+
+ check_command_args(command, command->first_argument,
+ rm_args, sizeof(rm_args)/sizeof(struct command_arg),
+ ' ');
+ fn_format(dirname, ds_directory.str, "", "", MY_UNPACK_FILENAME);
+
+ DBUG_PRINT("info", ("listing directory: %s", dirname));
+ /* Note that my_dir sorts the list if not given any flags */
+ if (!(dir_info= my_dir(dirname, MYF(MY_DONT_SORT | MY_WANT_STAT))))
+ {
+ error= 1;
+ goto end;
+ }
+ init_dynamic_string(&ds_file_to_remove, dirname, 1024, 1024);
+ dir_separator[0]= FN_LIBCHAR;
+ dir_separator[1]= 0;
+ dynstr_append(&ds_file_to_remove, dir_separator);
+ for (i= 0; i < (uint) dir_info->number_off_files; i++)
+ {
+ file= dir_info->dir_entry + i;
+ /* Remove only regular files, i.e. no directories etc. */
+ /* if (!MY_S_ISREG(file->mystat->st_mode)) */
+ /* MY_S_ISREG does not work here on Windows, just skip directories */
+ if (MY_S_ISDIR(file->mystat->st_mode))
+ continue;
+ if (ds_wild.length &&
+ wild_compare(file->name, ds_wild.str, 0))
+ continue;
+ ds_file_to_remove.length= ds_directory.length + 1;
+ ds_file_to_remove.str[ds_directory.length + 1]= 0;
+ dynstr_append(&ds_file_to_remove, file->name);
+ DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
+ error= my_delete(ds_file_to_remove.str, MYF(0)) != 0;
+ if (error)
+ break;
+ }
+ my_dirend(dir_info);
+
+end:
+ handle_command_error(command, error);
+ dynstr_free(&ds_directory);
+ dynstr_free(&ds_wild);
+ dynstr_free(&ds_file_to_remove);
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ SYNOPSIS
do_copy_file
command command handle
@@ -3688,49 +3780,58 @@ void do_perl(struct st_command *command)
sizeof(perl_args)/sizeof(struct command_arg),
' ');
- /* If no delimiter was provided, use EOF */
- if (ds_delimiter.length == 0)
- dynstr_set(&ds_delimiter, "EOF");
+ ds_script= command->content;
+ /* If it hasn't been done already by a loop iteration, fill it in */
+ if (! ds_script.str)
+ {
+ /* If no delimiter was provided, use EOF */
+ if (ds_delimiter.length == 0)
+ dynstr_set(&ds_delimiter, "EOF");
- init_dynamic_string(&ds_script, "", 1024, 1024);
- read_until_delimiter(&ds_script, &ds_delimiter);
+ init_dynamic_string(&ds_script, "", 1024, 1024);
+ read_until_delimiter(&ds_script, &ds_delimiter);
+ command->content= ds_script;
+ }
- DBUG_PRINT("info", ("Executing perl: %s", ds_script.str));
+ /* This function could be called even if "false", so check before doing */
+ if (cur_block->ok)
+ {
+ DBUG_PRINT("info", ("Executing perl: %s", ds_script.str));
- /* Create temporary file name */
- if ((fd= create_temp_file(temp_file_path, getenv("MYSQLTEST_VARDIR"),
- "tmp", O_CREAT | O_SHARE | O_RDWR,
- MYF(MY_WME))) < 0)
- die("Failed to create temporary file for perl command");
- my_close(fd, MYF(0));
+ /* Create temporary file name */
+ if ((fd= create_temp_file(temp_file_path, getenv("MYSQLTEST_VARDIR"),
+ "tmp", O_CREAT | O_SHARE | O_RDWR,
+ MYF(MY_WME))) < 0)
+ die("Failed to create temporary file for perl command");
+ my_close(fd, MYF(0));
- str_to_file(temp_file_path, ds_script.str, ds_script.length);
+ str_to_file(temp_file_path, ds_script.str, ds_script.length);
- /* Format the "perl <filename>" command */
- my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path);
+ /* Format the "perl <filename>" command */
+ my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path);
- if (!(res_file= popen(buf, "r")) && command->abort_on_error)
- die("popen(\"%s\", \"r\") failed", buf);
+ if (!(res_file= popen(buf, "r")) && command->abort_on_error)
+ die("popen(\"%s\", \"r\") failed", buf);
- while (fgets(buf, sizeof(buf), res_file))
- {
- if (disable_result_log)
- {
- buf[strlen(buf)-1]=0;
- DBUG_PRINT("exec_result",("%s", buf));
- }
- else
+ while (fgets(buf, sizeof(buf), res_file))
{
- replace_dynstr_append(&ds_res, buf);
+ if (disable_result_log)
+ {
+ buf[strlen(buf)-1]=0;
+ DBUG_PRINT("exec_result",("%s", buf));
+ }
+ else
+ {
+ replace_dynstr_append(&ds_res, buf);
+ }
}
- }
- error= pclose(res_file);
+ error= pclose(res_file);
- /* Remove the temporary file */
- my_delete(temp_file_path, MYF(0));
+ /* Remove the temporary file */
+ my_delete(temp_file_path, MYF(0));
- handle_command_error(command, WEXITSTATUS(error));
- dynstr_free(&ds_script);
+ handle_command_error(command, WEXITSTATUS(error));
+ }
dynstr_free(&ds_delimiter);
DBUG_VOID_RETURN;
}
@@ -4138,10 +4239,19 @@ void do_let(struct st_command *command)
int do_sleep(struct st_command *command, my_bool real_sleep)
{
int error= 0;
- char *p= command->first_argument;
- char *sleep_start, *sleep_end= command->end;
+ char *sleep_start, *sleep_end;
double sleep_val;
+ char *p;
+ static DYNAMIC_STRING ds_sleep;
+ const struct command_arg sleep_args[] = {
+ { "sleep_delay", ARG_STRING, TRUE, &ds_sleep, "Number of seconds to sleep." }
+ };
+ check_command_args(command, command->first_argument, sleep_args,
+ sizeof(sleep_args)/sizeof(struct command_arg),
+ ' ');
+ p= ds_sleep.str;
+ sleep_end= ds_sleep.str + ds_sleep.length;
while (my_isspace(charset_info, *p))
p++;
if (!*p)
@@ -4150,11 +4260,13 @@ int do_sleep(struct st_command *command, my_bool real_sleep)
/* Check that arg starts with a digit, not handled by my_strtod */
if (!my_isdigit(charset_info, *sleep_start))
die("Invalid argument to %.*s \"%s\"", command->first_word_len,
- command->query,command->first_argument);
+ command->query, sleep_start);
sleep_val= my_strtod(sleep_start, &sleep_end, &error);
+ check_eol_junk_line(sleep_end);
if (error)
die("Invalid argument to %.*s \"%s\"", command->first_word_len,
command->query, command->first_argument);
+ dynstr_free(&ds_sleep);
/* Fixed sleep time selected by --sleep option */
if (opt_sleep >= 0 && !real_sleep)
@@ -4163,7 +4275,6 @@ int do_sleep(struct st_command *command, my_bool real_sleep)
DBUG_PRINT("info", ("sleep_val: %f", sleep_val));
if (sleep_val)
my_sleep((ulong) (sleep_val * 1000000L));
- command->last_argument= sleep_end;
return 0;
}
@@ -4349,12 +4460,13 @@ typedef struct
{
const char *name;
uint code;
+ const char *text;
} st_error;
static st_error global_error_names[] =
{
#include <mysqld_ername.h>
- { 0, 0 }
+ { 0, 0, 0 }
};
uint get_errcode_from_name(char *error_name, char *error_end)
@@ -4701,7 +4813,8 @@ void do_close_connection(struct st_command *command)
if (con->util_mysql)
mysql_close(con->util_mysql);
con->util_mysql= 0;
-
+ con->pending= FALSE;
+
my_free(con->name, MYF(0));
/*
@@ -5035,7 +5148,7 @@ void do_connect(struct st_command *command)
{
if (!(con_slot= find_connection_by_name("-closed_connection-")))
die("Connection limit exhausted, you can have max %d connections",
- (int) (sizeof(connections)/sizeof(struct st_connection)));
+ opt_max_connections);
}
#ifdef EMBEDDED_LIBRARY
@@ -5154,6 +5267,12 @@ int do_done(struct st_command *command)
}
else
{
+ if (*cur_block->delim)
+ {
+ /* Restore "old" delimiter after false if block */
+ strcpy (delimiter, cur_block->delim);
+ delimiter_length= strlen(delimiter);
+ }
/* Pop block from stack, goto next line */
cur_block--;
parser.current_line++;
@@ -5212,6 +5331,7 @@ void do_block(enum block_cmd cmd, struct st_command* command)
cur_block++;
cur_block->cmd= cmd;
cur_block->ok= FALSE;
+ cur_block->delim[0]= '\0';
DBUG_VOID_RETURN;
}
@@ -5248,6 +5368,15 @@ void do_block(enum block_cmd cmd, struct st_command* command)
if (not_expr)
cur_block->ok = !cur_block->ok;
+ if (cur_block->ok)
+ {
+ cur_block->delim[0]= '\0';
+ } else
+ {
+ /* Remember "old" delimiter if entering a false if block */
+ strcpy (cur_block->delim, delimiter);
+ }
+
DBUG_PRINT("info", ("OK: %d", cur_block->ok));
var_free(&v);
@@ -5350,7 +5479,7 @@ int read_line(char *buf, int size)
found_eof:
if (cur_file->file != stdin)
{
- my_fclose(cur_file->file, MYF(0));
+ fclose(cur_file->file);
cur_file->file= 0;
}
my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
@@ -5753,7 +5882,7 @@ static struct my_option my_long_options[] =
{"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir,
(uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory where character sets are.", (uchar**) &opt_charsets_dir,
+ "Directory for character set files.", (uchar**) &opt_charsets_dir,
(uchar**) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use the compressed server/client protocol.",
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
@@ -5783,13 +5912,17 @@ static struct my_option my_long_options[] =
{"logdir", OPT_LOG_DIR, "Directory for log files", (uchar**) &opt_logdir,
(uchar**) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mark-progress", OPT_MARK_PROGRESS,
- "Write linenumber and elapsed time to <testname>.progress ",
+ "Write line number and elapsed time to <testname>.progress.",
(uchar**) &opt_mark_progress, (uchar**) &opt_mark_progress, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
- "Max number of connection attempts when connecting to server",
+ "Maximum number of attempts to connect to server.",
(uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0,
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
+ {"max-connections", OPT_MAX_CONNECTIONS,
+ "Max number of open connections to server",
+ (uchar**) &opt_max_connections, (uchar**) &opt_max_connections, 0,
+ GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
{"password", 'p', "Password to use when connecting to server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
@@ -5800,14 +5933,15 @@ static struct my_option my_long_options[] =
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
(uchar**) &opt_port,
(uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication",
+ {"ps-protocol", OPT_PS_PROTOCOL,
+ "Use prepared-statement protocol for communication.",
(uchar**) &ps_protocol, (uchar**) &ps_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"quiet", 's', "Suppress all normal output.", (uchar**) &silent,
(uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"record", 'r', "Record output of test_file into result file.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"result-file", 'R', "Read/Store result from/in this file.",
+ {"result-file", 'R', "Read/store result from/in this file.",
(uchar**) &result_file_name, (uchar**) &result_file_name, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"result-format-version", OPT_RESULT_FORMAT_VERSION,
@@ -5828,23 +5962,23 @@ static struct my_option my_long_options[] =
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"sleep", 'T', "Sleep always this many seconds on sleep commands.",
+ {"sleep", 'T', "Always sleep this many seconds on sleep commands.",
(uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
0, 0, 0},
- {"socket", 'S', "Socket file to use for connection.",
+ {"socket", 'S', "The socket file to use for connection.",
(uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
- {"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select",
+ {"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.",
(uchar**) &sp_protocol, (uchar**) &sp_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h"
{"tail-lines", OPT_TAIL_LINES,
- "Number of lines of the resul to include in a failure report",
+ "Number of lines of the result to include in a failure report.",
(uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0,
GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
{"test-file", 'x', "Read test from/in this file (default stdin).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"timer-file", 'm', "File where the timing in micro seconds is stored.",
+ {"timer-file", 'm', "File where the timing in microseconds is stored.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Temporary directory where sockets are put.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5854,7 +5988,7 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select",
+ {"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.",
(uchar**) &view_protocol, (uchar**) &view_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT,
@@ -5960,7 +6094,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fn_format(buff, argument, "", "", MY_UNPACK_FILENAME);
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
if (!(cur_file->file=
- my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
+ fopen(buff, "rb")))
die("Could not open '%s' for reading, errno: %d", buff, errno);
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
cur_file->lineno= 1;
@@ -6579,8 +6713,11 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
wait_query_thread_end(cn);
#endif /*EMBEDDED_LIBRARY*/
if (!(flags & QUERY_REAP_FLAG))
+ {
+ cn->pending= TRUE;
DBUG_VOID_RETURN;
-
+ }
+
do
{
/*
@@ -6664,6 +6801,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
end:
+ cn->pending= FALSE;
/*
We save the return code (mysql_errno(mysql)) from the last call sent
to the server into the mysqltest builtin variable $mysql_errno. This
@@ -7140,6 +7278,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
init_dynamic_string(&ds_warnings, NULL, 0, 256);
+ if (cn->pending && (flags & QUERY_SEND_FLAG))
+ die ("Cannot run query on connection between send and reap");
+
/*
Evaluate query if this is an eval command
*/
@@ -7662,12 +7803,6 @@ int main(int argc, char **argv)
/* Init expected errors */
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
- /* Init connections */
- memset(connections, 0, sizeof(connections));
- connections_end= connections +
- (sizeof(connections)/sizeof(struct st_connection)) - 1;
- next_con= connections + 1;
-
#ifdef EMBEDDED_LIBRARY
/* set appropriate stack for the 'query' threads */
(void) pthread_attr_init(&cn_thd_attrib);
@@ -7694,7 +7829,14 @@ int main(int argc, char **argv)
1024, 0, 0, get_var_key, var_free, MYF(0)))
die("Variable hash initialization failed");
- var_set_string("$MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
+ var_set_string("MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
+ var_set_string("MYSQL_SYSTEM_TYPE", SYSTEM_TYPE);
+ var_set_string("MYSQL_MACHINE_TYPE", MACHINE_TYPE);
+ if (sizeof(void *) == 8) {
+ var_set_string("MYSQL_SYSTEM_ARCHITECTURE", "64");
+ } else {
+ var_set_string("MYSQL_SYSTEM_ARCHITECTURE", "32");
+ }
memset(&master_pos, 0, sizeof(master_pos));
@@ -7722,6 +7864,13 @@ int main(int argc, char **argv)
verbose_msg("Tracing progress in '%s'.", progress_file.file_name());
}
+ /* Init connections, allocate 1 extra as buffer + 1 for default */
+ connections= (struct st_connection*)
+ my_malloc((opt_max_connections+2) * sizeof(struct st_connection),
+ MYF(MY_WME | MY_ZEROFILL));
+ connections_end= connections + opt_max_connections +1;
+ next_con= connections + 1;
+
var_set_int("$PS_PROTOCOL", ps_protocol);
var_set_int("$SP_PROTOCOL", sp_protocol);
var_set_int("$VIEW_PROTOCOL", view_protocol);
@@ -7825,7 +7974,8 @@ int main(int argc, char **argv)
command->type= Q_COMMENT;
}
- my_bool ok_to_do= cur_block->ok;
+ /* delimiter needs to be executed so we can continue to parse */
+ my_bool ok_to_do= cur_block->ok || command->type == Q_DELIMITER;
/*
Some commands need to be "done" the first time if they may get
re-iterated over in a true context. This can only happen if there's
@@ -7883,6 +8033,7 @@ int main(int argc, char **argv)
case Q_ECHO: do_echo(command); command_executed++; break;
case Q_SYSTEM: do_system(command); break;
case Q_REMOVE_FILE: do_remove_file(command); break;
+ case Q_REMOVE_FILES_WILDCARD: do_remove_files_wildcard(command); break;
case Q_MKDIR: do_mkdir(command); break;
case Q_RMDIR: do_rmdir(command); break;
case Q_LIST_FILES: do_list_files(command); break;
@@ -7920,6 +8071,13 @@ int main(int argc, char **argv)
*/
display_result_sorted= TRUE;
break;
+ case Q_LOWERCASE:
+ /*
+ Turn on lowercasing of result, will be reset after next
+ command
+ */
+ display_result_lower= TRUE;
+ break;
case Q_LET: do_let(command); break;
case Q_EVAL_RESULT:
die("'eval_result' command is deprecated");
@@ -8164,8 +8322,9 @@ int main(int argc, char **argv)
*/
free_all_replace();
- /* Also reset "sorted_result" */
+ /* Also reset "sorted_result" and "lowercase"*/
display_result_sorted= FALSE;
+ display_result_lower= FALSE;
}
last_command_executed= command_executed;
@@ -9505,7 +9664,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
if (pa->length+length >= pa->max_length)
{
if (!(new_pos= (uchar*) my_realloc((uchar*) pa->str,
- (uint) (pa->max_length+PS_MALLOC),
+ (uint) (pa->length+length+PS_MALLOC),
MYF(MY_WME))))
DBUG_RETURN(1);
if (new_pos != pa->str)
@@ -9516,7 +9675,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
char*);
pa->str=new_pos;
}
- pa->max_length+=PS_MALLOC;
+ pa->max_length= pa->length+length+PS_MALLOC;
}
if (pa->typelib.count >= pa->max_count-1)
{
@@ -9569,6 +9728,18 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
fix_win_paths(val, len);
#endif
+ if (display_result_lower)
+ {
+ /* Convert to lower case, and do this first */
+ char lower[512];
+ char *c= lower;
+ for (const char *v= val; *v; v++)
+ *c++= my_tolower(charset_info, *v);
+ *c= '\0';
+ /* Copy from this buffer instead */
+ val= lower;
+ }
+
if (glob_replace_regex)
{
/* Regex replace */