summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2010-02-07 12:21:11 +0100
committerBjorn Munch <Bjorn.Munch@sun.com>2010-02-07 12:21:11 +0100
commite814ed95bf41cb345bb13ab13ad2809191ba04a6 (patch)
treeca78a3e123dc747967f743f3b2738940bfad4f1f /client
parentad89fa1bcdf80475f38170c204a4ea670e1b15b8 (diff)
parent1c9ab8d6eecac36e44f277966f51a8874dfb3118 (diff)
downloadmariadb-git-e814ed95bf41cb345bb13ab13ad2809191ba04a6.tar.gz
merge from 5.1 main
Diffstat (limited to 'client')
-rw-r--r--client/client_priv.h15
-rw-r--r--client/mysql.cc24
-rw-r--r--client/mysql_upgrade.c4
-rw-r--r--client/mysqladmin.cc3
-rw-r--r--client/mysqlbinlog.cc8
-rw-r--r--client/mysqldump.c24
6 files changed, 59 insertions, 19 deletions
diff --git a/client/client_priv.h b/client/client_priv.h
index 06145232995..689f7277c2e 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 a future release. Please use %s instead.\n", (Old), (New)); \
+ } while(0);
+
enum options_client
{
OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
@@ -48,8 +57,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_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,
@@ -80,5 +89,7 @@ enum options_client
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
+ OPT_FIRST_SLAVE,
+ OPT_ALL,
OPT_MAX_CLIENT_OPTION
};
diff --git a/client/mysql.cc b/client/mysql.cc
index 9d078153a33..82a29816b8e 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"
@@ -1343,7 +1346,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},
@@ -1412,7 +1415,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},
@@ -1420,7 +1423,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.",
@@ -1627,7 +1630,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
init_tee(argument);
break;
case OPT_NOTEE:
- printf("WARNING: option deprecated; use --disable-tee instead.\n");
+ WARN_DEPRECATED(VER_CELOSIA, "--no-tee", "--disable-tee");
if (opt_outfile)
end_tee();
break;
@@ -1650,7 +1653,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:
@@ -1696,12 +1699,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
@@ -3524,7 +3533,8 @@ print_table_data_vertically(MYSQL_RES *result)
for (uint off=0; off < mysql_num_fields(result); off++)
{
field= mysql_fetch_field(result);
- tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
+ if (column_names)
+ tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
if (cur[off])
{
unsigned int i;
@@ -4194,7 +4204,7 @@ char *get_arg(char *line, my_bool get_next_arg)
if (*ptr == '\\' && ptr[1]) // escaped character
{
// Remove the backslash
- strmov(ptr, ptr+1);
+ strmov_overlapp(ptr, ptr+1);
}
else if ((!quoted && *ptr == ' ') || (quoted && *ptr == qtype))
{
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 52c3636219d..81dcdaa71f1 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -778,6 +778,10 @@ static int run_sql_fix_privilege_tables(void)
found_real_errors++;
print_line(line);
}
+ else if (strncmp(line, "WARNING", 7) == 0)
+ {
+ print_line(line);
+ }
} while ((line= get_line(line)) && *line);
}
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 2b93c149523..04e25fcf1ff 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 f55dc75df5d..1c0f6e5f96a 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 e9e3124b9cb..40e3e75cca2 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -179,7 +179,7 @@ HASH ignore_table;
static struct my_option my_long_options[] =
{
- {"all", 'a', "Deprecated. Use --create-options instead.",
+ {"all", OPT_ALL, "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',
@@ -230,7 +230,7 @@ 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},
@@ -268,7 +268,7 @@ static struct my_option my_long_options[] =
(uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"extended-insert", 'e',
- "Allows utilization of the new, much faster INSERT syntax.",
+ "Use multiple-row INSERT syntax that include several VALUES lists.",
(uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
@@ -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,15 @@ 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_ALL:
+ WARN_DEPRECATED(VER_CELOSIA, "--all", "--create-options");
+ 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;
@@ -808,7 +816,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
&err_ptr, &err_len);
if (err_len)
{
- strmake(buff, err_ptr, min(sizeof(buff), err_len));
+ strmake(buff, err_ptr, min(sizeof(buff) - 1, err_len));
fprintf(stderr, "Invalid mode to --compatible: %s\n", buff);
exit(1);
}
@@ -4486,7 +4494,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
for (; pos != end && *pos != ','; pos++) ;
var_len= (uint) (pos - start);
- strmake(buff, start, min(sizeof(buff), var_len));
+ strmake(buff, start, min(sizeof(buff) - 1, var_len));
find= find_type(buff, lib, var_len);
if (!find)
{