diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/client_priv.h | 15 | ||||
-rw-r--r-- | client/mysql.cc | 24 | ||||
-rw-r--r-- | client/mysql_upgrade.c | 4 | ||||
-rw-r--r-- | client/mysqladmin.cc | 3 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 8 | ||||
-rw-r--r-- | client/mysqldump.c | 24 |
6 files changed, 59 insertions, 19 deletions
diff --git a/client/client_priv.h b/client/client_priv.h index 07b5cd72d84..6a23af23594 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, @@ -81,5 +90,7 @@ enum options_client OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE, OPT_WRITE_BINLOG, OPT_DUMP_DATE, OPT_ABORT_SOURCE_ON_ERROR, + OPT_FIRST_SLAVE, + OPT_ALL, OPT_MAX_CLIENT_OPTION }; diff --git a/client/mysql.cc b/client/mysql.cc index aac4dc66719..6203e51d73e 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" @@ -1349,7 +1352,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}, @@ -1418,7 +1421,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}, @@ -1426,7 +1429,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.", @@ -1633,7 +1636,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; @@ -1656,7 +1659,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: @@ -1702,12 +1705,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 @@ -3530,7 +3539,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; @@ -4215,7 +4225,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 e8f336bcd99..24a006ce232 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -776,6 +776,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 12fc79cb19b..015b81803f2 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 68846136431..5ee34ca233e 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) { |