From 32efbaa19a86a34cb36b02da0ea5ed553677d11b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 17 Sep 2019 20:11:04 +0200 Subject: [PATCH] MDEV-7481 Replace max_long_data_size functionality with max_allowed_packet --- mysql-test/main/mysqld--help.result | 5 ----- mysql-test/main/variables.result | 3 --- mysql-test/main/variables.test | 5 ----- .../sys_vars/r/max_long_data_size_basic.result | 14 -------------- .../r/sysvars_server_embedded,32bit.rdiff | 9 --------- .../sys_vars/r/sysvars_server_embedded.result | 10 ---------- .../r/sysvars_server_notembedded,32bit.rdiff | 9 --------- .../r/sysvars_server_notembedded.result | 10 ---------- .../sys_vars/t/max_long_data_size_basic.test | 17 ----------------- sql/item.cc | 4 ++-- sql/mysqld.cc | 18 ------------------ sql/mysqld.h | 2 -- sql/sys_vars.cc | 12 ------------ sql/upgrade_conf_file.cc | 1 + 14 files changed, 3 insertions(+), 116 deletions(-) delete mode 100644 mysql-test/suite/sys_vars/r/max_long_data_size_basic.result delete mode 100644 mysql-test/suite/sys_vars/t/max_long_data_size_basic.test diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index 9d3f4198261..1f5a5196d60 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -567,10 +567,6 @@ The following specify which files/extra groups are read (specified before remain max_join_size records return an error --max-length-for-sort-data=# 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=# If there is more than this number of failed connect attempts due to invalid password, user will be blocked @@ -1571,7 +1567,6 @@ max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 max-length-for-sort-data 1024 -max-long-data-size 16777216 max-password-errors 18446744073709551615 max-prepared-stmt-count 16382 max-recursive-iterations 18446744073709551615 diff --git a/mysql-test/main/variables.result b/mysql-test/main/variables.result index 9cf751a1ee5..4fb40d718b5 100644 --- a/mysql-test/main/variables.result +++ b/mysql-test/main/variables.result @@ -1532,9 +1532,6 @@ SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; SET @@global.key_cache_block_size=@kcbs; -select @@max_long_data_size > 0; -@@max_long_data_size > 0 -1 # # Bug#11766424 59527: # Assert in DECIMAL_BIN_SIZE: diff --git a/mysql-test/main/variables.test b/mysql-test/main/variables.test index 846d2665013..b303958dff8 100644 --- a/mysql-test/main/variables.test +++ b/mysql-test/main/variables.test @@ -1264,11 +1264,6 @@ SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; SET @@global.key_cache_block_size=@kcbs; -# -# Bug#56976: added new start-up parameter -# -select @@max_long_data_size > 0; - --echo # --echo # Bug#11766424 59527: --echo # Assert in DECIMAL_BIN_SIZE: diff --git a/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result b/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result deleted file mode 100644 index 679a0d3611f..00000000000 --- a/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result +++ /dev/null @@ -1,14 +0,0 @@ -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 diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index 9ec15d3079a..2d72c262a21 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -521,15 +521,6 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 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 COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_RECURSIVE_ITERATIONS diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index a81d3bad4e2..8ee82af118c 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -1883,16 +1883,6 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO 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_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff index bfe56dbc1a9..31967729cc4 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff @@ -521,15 +521,6 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 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 COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_RECURSIVE_ITERATIONS diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index cb4496ca9d7..5ca6f073f33 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -2033,16 +2033,6 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO 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_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED diff --git a/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test b/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test deleted file mode 100644 index eefa61bd4b7..00000000000 --- a/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test +++ /dev/null @@ -1,17 +0,0 @@ -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; - diff --git a/sql/item.cc b/sql/item.cc index dbfe63fc403..bf59f4d8b85 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4128,12 +4128,12 @@ bool Item_param::set_longdata(const char *str, ulong length) (here), and first have to concatenate all pieces together, 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, "Parameter of prepared statement which is set through " "mysql_send_long_data() is longer than " - "'max_long_data_size' bytes", + "'max_allowed_packet' bytes", MYF(0)); DBUG_RETURN(true); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9988cdeab74..fde2a001620 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -340,7 +340,6 @@ PSI_statement_info stmt_info_rpl; /* the default log output is log tables */ 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 my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; static my_bool opt_short_log_format= 0, opt_silent_startup= 0; @@ -512,12 +511,6 @@ long opt_secure_timestamp; uint default_password_lifetime; 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; /** 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) case OPT_PLUGIN_LOAD_ADD: opt_plugin_load_list_ptr->push_back(new i_string(argument)); break; - case OPT_MAX_LONG_DATA_SIZE: - max_long_data_size_used= true; - break; case OPT_PFS_INSTRUMENT: { #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE @@ -8753,14 +8743,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr) 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 */ max_user_connections_checking= global_system_variables.max_user_connections != 0; diff --git a/sql/mysqld.h b/sql/mysqld.h index a5dffe0c222..a518b6f34cd 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -157,7 +157,6 @@ extern plugin_ref *opt_gtid_pos_auto_plugins; extern bool opt_endinfo, using_udf_functions; extern my_bool locked_in_memory; extern bool opt_using_transactions; -extern ulong max_long_data_size; extern ulong current_pid; extern ulong expire_logs_days; extern my_bool relay_log_recovery; @@ -668,7 +667,6 @@ enum options_mysqld OPT_LOG_BASENAME, OPT_LOG_ERROR, OPT_LOWER_CASE_TABLE_NAMES, - OPT_MAX_LONG_DATA_SIZE, OPT_PLUGIN_LOAD, OPT_PLUGIN_LOAD_ADD, OPT_PFS_INSTRUMENT, diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 1adc20af657..d91c42c8894 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -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), 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 Sys_var_uint Sys_max_prepared_stmt_count( "max_prepared_stmt_count", diff --git a/sql/upgrade_conf_file.cc b/sql/upgrade_conf_file.cc index 4e167f0263f..7219f948745 100644 --- a/sql/upgrade_conf_file.cc +++ b/sql/upgrade_conf_file.cc @@ -115,6 +115,7 @@ static const char *removed_variables[] = "innodb_use_trim", "log", "log_slow_queries", +"max_long_data_size", "rpl_recovery_rank", "sql_big_tables", "sql_low_priority_updates",