diff options
author | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-03-15 18:57:36 +0600 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-03-15 18:57:36 +0600 |
commit | 10f5982ee546f41df56dbf2f2933e29cc493db2b (patch) | |
tree | 0f5b82b368f0393b2467be245564bcd49d0933f9 /sql/mysqld.cc | |
parent | 14df359b396b5eb3253826b4e81af7c41125e039 (diff) | |
parent | 6c2f5e306ca3fa621cd25cedd49181d6e0d5cbc6 (diff) | |
download | mariadb-git-10f5982ee546f41df56dbf2f2933e29cc493db2b.tar.gz |
Manual merge from mysql-5.1 for Bug#11764168 (56976: Severe denial
of service in prepared statements).
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 24ce134b40d..154ddbed8fb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -324,6 +324,7 @@ static PSI_rwlock_key key_rwlock_openssl; /* 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; /* See Bug#56666 and Bug#56760 */; volatile bool ready_to_exit; @@ -478,6 +479,11 @@ ulong specialflag=0; ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; ulong max_connections, max_connect_errors; +/* + Maximum length of parameter value which can be set through + mysql_send_long_data() call. +*/ +ulong max_long_data_size; /** Limit of the total number of prepared statements in the server. Is necessary to protect the server against out-of-memory attacks. @@ -7160,6 +7166,10 @@ mysqld_get_one_option(int optid, if (argument == NULL) /* no argument */ log_error_file_ptr= const_cast<char*>(""); break; + case OPT_MAX_LONG_DATA_SIZE: + max_long_data_size_used= true; + WARN_DEPRECATED(NULL, 5, 6, "--max_long_data_size", "'--max_allowed_packet'"); + break; } return 0; } @@ -7386,6 +7396,13 @@ 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) + max_long_data_size= global_system_variables.max_allowed_packet; + return 0; } |