List:Commits« Previous MessageNext Message »
From:Dmitry Shulga Date:April 5 2011 3:04pm
Subject:bzr commit into mysql-trunk branch (Dmitry.Shulga:3328) Bug#11764168
View as plain text  
#At file:///Users/shulga/projects/mysql/mysql-trunk/ based on revid:alfranio.correia@stripped

 3328 Dmitry Shulga	2011-04-05
      follow-up for patch for
      Bug#11764168: 56976: SEVERE DENIAL OF SERVICE IN PREPARED STATEMENTS
      
      Removed using of max-long-data-size variable since
      it was marked as deprecated. Use max-allowed-packet instead.
      
      Variable max-long-data-size was introduced as temporal solution 
      in order to make possible send of BLOB with size greater than 1GB.

    modified:
      sql/item.cc
      sql/mysqld.cc
      sql/sys_vars.cc
=== modified file 'sql/item.cc'
--- a/sql/item.cc	2011-04-04 08:47:25 +0000
+++ b/sql/item.cc	2011-04-05 15:04:16 +0000
@@ -2979,12 +2979,12 @@ bool Item_param::set_longdata(const char
     (here), and first have to concatenate all pieces together,
     write query to the binary log and only then perform conversion.
   */
-  if (str_value.length() + length > max_long_data_size)
+  if (str_value.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);
   }

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2011-04-04 08:47:25 +0000
+++ b/sql/mysqld.cc	2011-04-05 15:04:16 +0000
@@ -323,7 +323,6 @@ 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;
@@ -482,11 +481,6 @@ 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.
@@ -7592,10 +7586,6 @@ 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, "--max_long_data_size", "'--max_allowed_packet'");
-    break;
   }
   return 0;
 }
@@ -7830,13 +7820,6 @@ static int get_options(int *argc_ptr, ch
 
   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;
 }
 

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2011-04-04 10:06:13 +0000
+++ b/sql/sys_vars.cc	2011-04-05 15:04:16 +0000
@@ -1420,16 +1420,6 @@ static Sys_var_ulong Sys_max_length_for_
        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));
-
 static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count);
 static Sys_var_ulong Sys_max_prepared_stmt_count(
        "max_prepared_stmt_count",


Attachment: [text/bzr-bundle] bzr/dmitry.shulga@oracle.com-20110405150416-2fkkal0m3pbgrlga.bundle
Thread
bzr commit into mysql-trunk branch (Dmitry.Shulga:3328) Bug#11764168Dmitry Shulga5 Apr
  • Re: bzr commit into mysql-trunk branch (Dmitry.Shulga:3328) Bug#11764168Davi Arnaut7 Apr