Commit 8af7a994 authored by Monty's avatar Monty Committed by Sergei Golubchik

Fixed warnings when using deprecated variables

Also fixed that all unused variables are using the same variable comment.
The warning will be tested with the next commit that deprecates the
variable alter_algorithm.
parent c8624163
......@@ -29,8 +29,8 @@ explain select * from t1 where nm like '500%' AND fl2 = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
Warnings:
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations
Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
......@@ -97,8 +97,8 @@ explain select * from t1 where nm like '500%' AND fl2 = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
Warnings:
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations
Warning 4200 The variable '@@optimizer_adjust_secondary_key_costs' is deleted and ignored. It it only exists for compatiblity with old installations
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
......
......@@ -1545,7 +1545,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LARGE_PAGE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Previously showed the size of large memory pages, unused since multiple page size support was added
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
......
......@@ -1695,7 +1695,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LARGE_PAGE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Previously showed the size of large memory pages, unused since multiple page size support was added
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
......
......@@ -420,20 +420,28 @@ double sys_var::val_real(bool *is_null,
return ret;
}
/* Marker if the variable is deleted instead of depricated */
const char *UNUSED_HELP="Unused";
void sys_var::do_deprecated_warning(THD *thd)
{
if (option.deprecation_substitute != NULL)
{
char buf1[NAME_CHAR_LEN + 3];
char buf2[NAME_CHAR_LEN + 3];
strxnmov(buf1, sizeof(buf1)-1, "@@", name.str, 0);
if (option.comment == UNUSED_HELP)
my_error(ER_VARIABLE_DELETED, MYF(ME_WARNING), buf1);
else
{
char buf2[NAME_CHAR_LEN + 3];
if (!IS_DEPRECATED_NO_REPLACEMENT(option.deprecation_substitute))
strxnmov(buf2, sizeof(buf2)-1, "@@", option.deprecation_substitute, 0);
else
buf2[0]= 0;
warn_deprecated<999999>(thd, buf1, buf2);
}
}
}
/**
......
......@@ -12278,3 +12278,5 @@ ER_SEQUENCE_TABLE_CANNOT_HAVE_ANY_CONSTRAINTS
eng "Sequence tables cannot have any constraints"
ER_SEQUENCE_TABLE_ORDER_BY
eng "ORDER BY"
ER_VARIABLE_DELETED
eng "The variable '%s' is deleted and ignored. It it only exists for compatiblity with old installations"
......@@ -1511,8 +1511,7 @@ static Sys_var_mybool Sys_large_files_support(
static Sys_var_uint Sys_large_page_size(
"large_page_size",
"Previously showed the size of large memory pages, unused since "
"multiple page size support was added",
UNUSED_HELP,
READ_ONLY GLOBAL_VAR(opt_large_page_size), NO_CMD_LINE,
VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0),
......@@ -1901,7 +1900,7 @@ static Sys_var_ulonglong Sys_max_heap_table_size(
static ulong mdl_locks_cache_size;
static Sys_var_ulong Sys_metadata_locks_cache_size(
"metadata_locks_cache_size", "Unused",
"metadata_locks_cache_size", UNUSED_HELP,
READ_ONLY GLOBAL_VAR(mdl_locks_cache_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1, 1024*1024), DEFAULT(1024),
BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0),
......@@ -1909,7 +1908,7 @@ static Sys_var_ulong Sys_metadata_locks_cache_size(
static ulong mdl_locks_hash_partitions;
static Sys_var_ulong Sys_metadata_locks_hash_instances(
"metadata_locks_hash_instances", "Unused",
"metadata_locks_hash_instances", UNUSED_HELP,
READ_ONLY GLOBAL_VAR(mdl_locks_hash_partitions), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1, 1024), DEFAULT(8),
BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0),
......@@ -2989,7 +2988,7 @@ static Sys_var_ulong Sys_optimizer_trace_max_mem_size(
static Sys_var_ulong Sys_optimizer_adjust_secondary_key_costs(
"optimizer_adjust_secondary_key_costs",
"Unused",
UNUSED_HELP,
SESSION_VAR(optimizer_adjust_secondary_key_costs), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 2), DEFAULT(0), BLOCK_SIZE(1),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0),
......
......@@ -64,6 +64,8 @@
#define PARSED_EARLY sys_var::PARSE_EARLY+
#define NO_SET_STMT sys_var::NO_SET_STATEMENT+
extern const char *UNUSED_HELP;
/*
Sys_var_bit meaning is reversed, like in
@@foreign_key_checks <-> OPTION_NO_FOREIGN_KEY_CHECKS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment