summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-01-24 00:09:23 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-01-24 00:09:23 +0300
commit7b5f5d5c37b0a59a04645007cc44446274666832 (patch)
tree5e503468493119925995d64ea920534747a99d04 /client
parent12318ab2a3a80b2230de8c7d98060b41a6972e25 (diff)
parented79d2ecbbb6b88d328dd32cba3e53051744e9dc (diff)
downloadmariadb-git-7b5f5d5c37b0a59a04645007cc44446274666832.tar.gz
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Diffstat (limited to 'client')
-rw-r--r--client/client_priv.h12
-rw-r--r--client/mysql.cc17
-rw-r--r--client/mysqladmin.cc3
-rw-r--r--client/mysqlbinlog.cc8
-rw-r--r--client/mysqldump.c11
5 files changed, 41 insertions, 10 deletions
diff --git a/client/client_priv.h b/client/client_priv.h
index e99d34ffa97..fddffd70866 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -31,6 +31,15 @@
# endif
#endif
+/* Version numbers for deprecation messages */
+#define VER_CELOSIA "5.6"
+
+#define WARN_DEPRECATED(Ver,Old,New) \
+ do { \
+ printf("Warning: The option '%s' is deprecated and will be removed " \
+ "in MySQL %s. Please use %s instead.\n", (Old), (Ver), (New)); \
+ } while(0);
+
enum options_client
{
OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
@@ -49,7 +58,7 @@ enum options_client
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_POSITION, 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,
@@ -81,5 +90,6 @@ enum options_client
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
OPT_INIT_COMMAND,
+ OPT_FIRST_SLAVE,
OPT_MAX_CLIENT_OPTION
};
diff --git a/client/mysql.cc b/client/mysql.cc
index 0fb388da513..a2f8044a978 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -54,6 +54,9 @@ static char *server_version= NULL;
/* Array of options to pass to libemysqld */
#define MAX_SERVER_ARGS 64
+/* Version numbers for deprecation messages */
+#define VER_CELOSIA "5.6"
+
void* sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr);
#include "sql_string.h"
@@ -1344,7 +1347,7 @@ 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},
{"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},
@@ -1417,7 +1420,7 @@ static struct my_option my_long_options[] =
{"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},
@@ -1425,7 +1428,7 @@ 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.",
@@ -1652,7 +1655,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
break;
case OPT_NOPAGER:
- printf("WARNING: option deprecated; use --disable-pager instead.\n");
+ WARN_DEPRECATED(VER_CELOSIA, "--no-pager", "--disable-pager");
opt_nopager= 1;
break;
case OPT_MYSQL_PROTOCOL:
@@ -1698,12 +1701,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if (!(status.line_buff= batch_readline_command(status.line_buff, argument)))
return 1;
break;
+ case 'g':
+ WARN_DEPRECATED(VER_CELOSIA, "-g, --no-named-commands", "--skip-named-commands");
+ break;
case 'o':
if (argument == disabled_my_option)
one_database= 0;
else
one_database= skip_updates= 1;
break;
+ case 'O':
+ WARN_DEPRECATED(VER_CELOSIA, "-O, --set-variable", "--variable-name=value");
+ break;
case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index a3eee14e0d1..3c10109b573 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -282,6 +282,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
charsets_dir = argument;
#endif
break;
+ case 'O':
+ WARN_DEPRECATED(VER_CELOSIA, "--set-variable", "--variable-name=value");
+ break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index f87f5b92f10..3a442cbec9f 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -41,6 +41,7 @@
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
+
char server_version[SERVER_VERSION_LENGTH];
ulong server_id = 0;
@@ -1060,7 +1061,7 @@ 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.",
+ {"position", OPT_POSITION, "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 */
@@ -1103,7 +1104,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,
@@ -1314,6 +1315,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'R':
remote_opt= 1;
break;
+ case OPT_POSITION:
+ WARN_DEPRECATED(VER_CELOSIA, "--position", "--start-position");
+ break;
case OPT_MYSQL_PROTOCOL:
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 4e39612b38d..ab41b88493f 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -282,7 +282,7 @@ static struct my_option my_long_options[] =
(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.",
+ {"first-slave", OPT_FIRST_SLAVE, "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},
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
@@ -366,8 +366,7 @@ static struct my_option my_long_options[] =
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',"Suppress the SET NAMES statement",
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.",
@@ -760,6 +759,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage();
exit(0);
+ case 'O':
+ WARN_DEPRECATED(VER_CELOSIA, "--set-variable", "--variable-name=value");
+ break;
+ case (int) OPT_FIRST_SLAVE:
+ WARN_DEPRECATED(VER_CELOSIA, "--first-slave", "--lock-all-tables");
+ break;
case (int) OPT_MASTER_DATA:
if (!argument) /* work like in old versions */
opt_master_data= MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL;