Commit 32efbaa1 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-7481 Replace max_long_data_size functionality with max_allowed_packet

parent 12414cd9
...@@ -567,10 +567,6 @@ The following specify which files/extra groups are read (specified before remain ...@@ -567,10 +567,6 @@ The following specify which files/extra groups are read (specified before remain
max_join_size records return an error max_join_size records return an error
--max-length-for-sort-data=# --max-length-for-sort-data=#
Max number of bytes in sorted records Max number of bytes in sorted records
--max-long-data-size=#
The maximum BLOB length to send to server from
mysql_send_long_data API. Deprecated option; use
max_allowed_packet instead.
--max-password-errors=# --max-password-errors=#
If there is more than this number of failed connect If there is more than this number of failed connect
attempts due to invalid password, user will be blocked attempts due to invalid password, user will be blocked
...@@ -1571,7 +1567,6 @@ max-error-count 64 ...@@ -1571,7 +1567,6 @@ max-error-count 64
max-heap-table-size 16777216 max-heap-table-size 16777216
max-join-size 18446744073709551615 max-join-size 18446744073709551615
max-length-for-sort-data 1024 max-length-for-sort-data 1024
max-long-data-size 16777216
max-password-errors 18446744073709551615 max-password-errors 18446744073709551615
max-prepared-stmt-count 16382 max-prepared-stmt-count 16382
max-recursive-iterations 18446744073709551615 max-recursive-iterations 18446744073709551615
......
...@@ -1532,9 +1532,6 @@ SET @@global.max_binlog_cache_size=DEFAULT; ...@@ -1532,9 +1532,6 @@ SET @@global.max_binlog_cache_size=DEFAULT;
SET @@global.max_join_size=DEFAULT; SET @@global.max_join_size=DEFAULT;
SET @@global.key_buffer_size=@kbs; SET @@global.key_buffer_size=@kbs;
SET @@global.key_cache_block_size=@kcbs; SET @@global.key_cache_block_size=@kcbs;
select @@max_long_data_size > 0;
@@max_long_data_size > 0
1
# #
# Bug#11766424 59527: # Bug#11766424 59527:
# Assert in DECIMAL_BIN_SIZE: # Assert in DECIMAL_BIN_SIZE:
......
...@@ -1264,11 +1264,6 @@ SET @@global.max_join_size=DEFAULT; ...@@ -1264,11 +1264,6 @@ SET @@global.max_join_size=DEFAULT;
SET @@global.key_buffer_size=@kbs; SET @@global.key_buffer_size=@kbs;
SET @@global.key_cache_block_size=@kcbs; SET @@global.key_cache_block_size=@kcbs;
#
# Bug#56976: added new start-up parameter
#
select @@max_long_data_size > 0;
--echo # --echo #
--echo # Bug#11766424 59527: --echo # Bug#11766424 59527:
--echo # Assert in DECIMAL_BIN_SIZE: --echo # Assert in DECIMAL_BIN_SIZE:
......
select @@global.max_long_data_size=20;
@@global.max_long_data_size=20
0
select @@session.max_long_data_size;
ERROR HY000: Variable 'max_long_data_size' is a GLOBAL variable
SELECT @@global.max_long_data_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_long_data_size';
@@global.max_long_data_size = VARIABLE_VALUE
1
set global max_long_data_size=1;
ERROR HY000: Variable 'max_long_data_size' is a read only variable
set session max_long_data_size=1;
ERROR HY000: Variable 'max_long_data_size' is a read only variable
...@@ -521,15 +521,6 @@ ...@@ -521,15 +521,6 @@
VARIABLE_COMMENT Max number of bytes in sorted records VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4 NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608 NUMERIC_MAX_VALUE 8388608
@@ -1874,7 +1874,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LONG_DATA_SIZE
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
@@ -1904,7 +1904,7 @@ READ_ONLY NO @@ -1904,7 +1904,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_RECURSIVE_ITERATIONS VARIABLE_NAME MAX_RECURSIVE_ITERATIONS
......
...@@ -1883,16 +1883,6 @@ NUMERIC_BLOCK_SIZE 1 ...@@ -1883,16 +1883,6 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LONG_DATA_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_PASSWORD_ERRORS VARIABLE_NAME MAX_PASSWORD_ERRORS
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED VARIABLE_TYPE INT UNSIGNED
......
...@@ -521,15 +521,6 @@ ...@@ -521,15 +521,6 @@
VARIABLE_COMMENT Max number of bytes in sorted records VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4 NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608 NUMERIC_MAX_VALUE 8388608
@@ -2024,7 +2024,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LONG_DATA_SIZE
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
@@ -2054,7 +2054,7 @@ READ_ONLY NO @@ -2054,7 +2054,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_RECURSIVE_ITERATIONS VARIABLE_NAME MAX_RECURSIVE_ITERATIONS
......
...@@ -2033,16 +2033,6 @@ NUMERIC_BLOCK_SIZE 1 ...@@ -2033,16 +2033,6 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LONG_DATA_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_PASSWORD_ERRORS VARIABLE_NAME MAX_PASSWORD_ERRORS
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED VARIABLE_TYPE INT UNSIGNED
......
select @@global.max_long_data_size=20;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.max_long_data_size;
# Show that value of the variable matches the value in the GLOBAL I_S table
SELECT @@global.max_long_data_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_long_data_size';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global max_long_data_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session max_long_data_size=1;
...@@ -4128,12 +4128,12 @@ bool Item_param::set_longdata(const char *str, ulong length) ...@@ -4128,12 +4128,12 @@ bool Item_param::set_longdata(const char *str, ulong length)
(here), and first have to concatenate all pieces together, (here), and first have to concatenate all pieces together,
write query to the binary log and only then perform conversion. write query to the binary log and only then perform conversion.
*/ */
if (value.m_string.length() + length > max_long_data_size) if (value.m_string.length() + length > current_thd->variables.max_allowed_packet)
{ {
my_message(ER_UNKNOWN_ERROR, my_message(ER_UNKNOWN_ERROR,
"Parameter of prepared statement which is set through " "Parameter of prepared statement which is set through "
"mysql_send_long_data() is longer than " "mysql_send_long_data() is longer than "
"'max_long_data_size' bytes", "'max_allowed_packet' bytes",
MYF(0)); MYF(0));
DBUG_RETURN(true); DBUG_RETURN(true);
} }
......
...@@ -340,7 +340,6 @@ PSI_statement_info stmt_info_rpl; ...@@ -340,7 +340,6 @@ PSI_statement_info stmt_info_rpl;
/* the default log output is log tables */ /* the default log output is log tables */
static bool lower_case_table_names_used= 0; static bool lower_case_table_names_used= 0;
static bool max_long_data_size_used= false;
static bool volatile select_thread_in_use, signal_thread_in_use; static bool volatile select_thread_in_use, signal_thread_in_use;
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
static my_bool opt_short_log_format= 0, opt_silent_startup= 0; static my_bool opt_short_log_format= 0, opt_silent_startup= 0;
...@@ -512,12 +511,6 @@ long opt_secure_timestamp; ...@@ -512,12 +511,6 @@ long opt_secure_timestamp;
uint default_password_lifetime; uint default_password_lifetime;
my_bool disconnect_on_expired_password; my_bool disconnect_on_expired_password;
/*
Maximum length of parameter value which can be set through
mysql_send_long_data() call.
*/
ulong max_long_data_size;
bool max_user_connections_checking=0; bool max_user_connections_checking=0;
/** /**
Limit of the total number of prepared statements in the server. Limit of the total number of prepared statements in the server.
...@@ -8335,9 +8328,6 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) ...@@ -8335,9 +8328,6 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
case OPT_PLUGIN_LOAD_ADD: case OPT_PLUGIN_LOAD_ADD:
opt_plugin_load_list_ptr->push_back(new i_string(argument)); opt_plugin_load_list_ptr->push_back(new i_string(argument));
break; break;
case OPT_MAX_LONG_DATA_SIZE:
max_long_data_size_used= true;
break;
case OPT_PFS_INSTRUMENT: case OPT_PFS_INSTRUMENT:
{ {
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
...@@ -8753,14 +8743,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr) ...@@ -8753,14 +8743,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
opt_readonly= read_only; opt_readonly= read_only;
/*
If max_long_data_size is not specified explicitly use
value of max_allowed_packet.
*/
if (!max_long_data_size_used)
SYSVAR_AUTOSIZE(max_long_data_size,
global_system_variables.max_allowed_packet);
/* Remember if max_user_connections was 0 at startup */ /* Remember if max_user_connections was 0 at startup */
max_user_connections_checking= global_system_variables.max_user_connections != 0; max_user_connections_checking= global_system_variables.max_user_connections != 0;
......
...@@ -157,7 +157,6 @@ extern plugin_ref *opt_gtid_pos_auto_plugins; ...@@ -157,7 +157,6 @@ extern plugin_ref *opt_gtid_pos_auto_plugins;
extern bool opt_endinfo, using_udf_functions; extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory; extern my_bool locked_in_memory;
extern bool opt_using_transactions; extern bool opt_using_transactions;
extern ulong max_long_data_size;
extern ulong current_pid; extern ulong current_pid;
extern ulong expire_logs_days; extern ulong expire_logs_days;
extern my_bool relay_log_recovery; extern my_bool relay_log_recovery;
...@@ -668,7 +667,6 @@ enum options_mysqld ...@@ -668,7 +667,6 @@ enum options_mysqld
OPT_LOG_BASENAME, OPT_LOG_BASENAME,
OPT_LOG_ERROR, OPT_LOG_ERROR,
OPT_LOWER_CASE_TABLE_NAMES, OPT_LOWER_CASE_TABLE_NAMES,
OPT_MAX_LONG_DATA_SIZE,
OPT_PLUGIN_LOAD, OPT_PLUGIN_LOAD,
OPT_PLUGIN_LOAD_ADD, OPT_PLUGIN_LOAD_ADD,
OPT_PFS_INSTRUMENT, OPT_PFS_INSTRUMENT,
......
...@@ -2320,18 +2320,6 @@ static Sys_var_ulong Sys_max_length_for_sort_data( ...@@ -2320,18 +2320,6 @@ static Sys_var_ulong Sys_max_length_for_sort_data(
SESSION_VAR(max_length_for_sort_data), CMD_LINE(REQUIRED_ARG), SESSION_VAR(max_length_for_sort_data), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(4, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1)); VALID_RANGE(4, 8192*1024L), DEFAULT(1024), BLOCK_SIZE(1));
static Sys_var_ulong Sys_max_long_data_size(
"max_long_data_size",
"The maximum BLOB length to send to server from "
"mysql_send_long_data API. Deprecated option; "
"use max_allowed_packet instead.",
READ_ONLY GLOBAL_VAR(max_long_data_size),
CMD_LINE(REQUIRED_ARG, OPT_MAX_LONG_DATA_SIZE),
VALID_RANGE(1024, UINT_MAX32), DEFAULT(1024*1024),
BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(0), ON_UPDATE(0),
DEPRECATED("'@@max_allowed_packet'"));
static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count); static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count);
static Sys_var_uint Sys_max_prepared_stmt_count( static Sys_var_uint Sys_max_prepared_stmt_count(
"max_prepared_stmt_count", "max_prepared_stmt_count",
......
...@@ -115,6 +115,7 @@ static const char *removed_variables[] = ...@@ -115,6 +115,7 @@ static const char *removed_variables[] =
"innodb_use_trim", "innodb_use_trim",
"log", "log",
"log_slow_queries", "log_slow_queries",
"max_long_data_size",
"rpl_recovery_rank", "rpl_recovery_rank",
"sql_big_tables", "sql_big_tables",
"sql_low_priority_updates", "sql_low_priority_updates",
......
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