List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:March 25 2011 12:55pm
Subject:bzr commit into mysql-5.5 branch (Georgi.Kodinov:3398) Bug#11766769
View as plain text  
#At file:///Users/kgeorge/mysql/work/B11766769-5.5/ based on revid:luis.soares@stripped

 3398 Georgi Kodinov	2011-03-25 [merge]
      Merged bug #11766769 to 5.5. 
      Added back the specific warning number.

    modified:
      mysql-test/r/packet.result
      mysql-test/r/variables.result
      mysql-test/suite/rpl/r/rpl_packet.result
      mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
      mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
      mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
      mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
      mysql-test/t/variables.test
      sql/mysqld.cc
      sql/share/errmsg-utf8.txt
      sql/sys_vars.cc
=== modified file 'mysql-test/r/packet.result'
--- a/mysql-test/r/packet.result	2009-06-19 09:29:21 +0000
+++ b/mysql-test/r/packet.result	2011-03-25 12:55:22 +0000
@@ -3,6 +3,7 @@ set @net_buffer_length=@@global.net_buff
 set global max_allowed_packet=100;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '100'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 set global net_buffer_length=100;
 Warnings:
 Warning	1292	Truncated incorrect net_buffer_length value: '100'

=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result	2011-03-15 12:57:36 +0000
+++ b/mysql-test/r/variables.result	2011-03-25 12:55:22 +0000
@@ -505,6 +505,7 @@ set low_priority_updates=1;
 set global max_allowed_packet=100;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '100'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 set global max_binlog_cache_size=100;
 Warnings:
 Warning	1292	Truncated incorrect max_binlog_cache_size value: '100'
@@ -1059,6 +1060,8 @@ set global max_write_lock_count      =de
 set global myisam_data_pointer_size  =@my_myisam_data_pointer_size;
 set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size;
 set global net_buffer_length         =@my_net_buffer_length;
+Warnings:
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 set global net_write_timeout         =@my_net_write_timeout;
 set global net_read_timeout          =@my_net_read_timeout;
 set global query_cache_limit         =@my_query_cache_limit;
@@ -1547,6 +1550,30 @@ SET @@global.max_binlog_cache_size=DEFAU
 SET @@global.max_join_size=DEFAULT;
 SET @@global.key_buffer_size=@kbs;
 SET @@global.key_cache_block_size=@kcbs;
+#
+# Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET 
+#   ARE NOT BEING HONORED
+#
+CREATE TABLE t1 (a MEDIUMTEXT);
+SET GLOBAL max_allowed_packet=2048;
+Warnings:
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+SET GLOBAL net_buffer_length=4096;
+Warnings:
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+SHOW SESSION VARIABLES LIKE 'max_allowed_packet';
+Variable_name	Value
+max_allowed_packet	2048
+SHOW SESSION VARIABLES LIKE 'net_buffer_length';
+Variable_name	Value
+net_buffer_length	4096
+ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes
+at this point the connection is disconnected by the server
+SELECT LENGTH(a) FROM t1;
+LENGTH(a)
+SET GLOBAL max_allowed_packet=default;
+SET GLOBAL net_buffer_length=default;
+DROP TABLE t1;
 End of 5.1 tests
 
 #

=== modified file 'mysql-test/suite/rpl/r/rpl_packet.result'
--- a/mysql-test/suite/rpl/r/rpl_packet.result	2010-12-19 17:07:28 +0000
+++ b/mysql-test/suite/rpl/r/rpl_packet.result	2011-03-25 12:55:22 +0000
@@ -49,6 +49,8 @@ SET @max_allowed_packet_2= @@session.max
 ==== clean up ====
 DROP TABLE t1;
 SET @@global.max_allowed_packet= 1024;
+Warnings:
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SET @@global.net_buffer_length= 1024;
 DROP TABLE t1;
 RESET SLAVE;

=== modified file 'mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt	2008-02-05 13:52:20 +0000
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt	2011-03-25 10:57:27 +0000
@@ -1 +1 @@
---read_buffer_size=12K --max_allowed_packet=8K
+--read_buffer_size=12K --max_allowed_packet=8K --net-buffer-length=8K

=== modified file 'mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt	2008-02-05 13:52:20 +0000
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt	2011-03-25 10:57:27 +0000
@@ -1 +1 @@
---max_allowed_packet=8K
+--max_allowed_packet=8K --net-buffer-length=8K

=== modified file 'mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result'
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result	2009-12-22 09:35:56 +0000
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result	2011-03-25 12:55:22 +0000
@@ -7,6 +7,7 @@ SET @@global.max_allowed_packet = DEFAUL
 SET @@global.max_allowed_packet = 1000;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '1000'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SET @@global.max_allowed_packet = DEFAULT;
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
@@ -25,12 +26,15 @@ SELECT @@global.max_allowed_packet = 104
 1
 '#--------------------FN_DYNVARS_070_03-------------------------#'
 SET @@global.max_allowed_packet = 1024;
+Warnings:
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
 SET @@global.max_allowed_packet = 1025;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '1025'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
@@ -74,18 +78,21 @@ SELECT @@session.max_allowed_packet;
 SET @@global.max_allowed_packet = 0;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '0'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
 SET @@global.max_allowed_packet = -1024;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '-1024'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
 SET @@global.max_allowed_packet = 1023;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '1023'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
@@ -148,17 +155,21 @@ WHERE VARIABLE_NAME='max_allowed_packet'
 SET @@global.max_allowed_packet = TRUE;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '1'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
 SET @@global.max_allowed_packet = FALSE;
 Warnings:
 Warning	1292	Truncated incorrect max_allowed_packet value: '0'
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet
 1024
 '#---------------------FN_DYNVARS_070_09----------------------#'
 SET @@global.max_allowed_packet = 2048;
+Warnings:
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SELECT @@max_allowed_packet = @@global.max_allowed_packet;
 @@max_allowed_packet = @@global.max_allowed_packet
 0

=== modified file 'mysql-test/suite/sys_vars/r/max_allowed_packet_func.result'
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result	2009-01-29 16:59:46 +0000
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result	2011-03-25 12:55:22 +0000
@@ -23,6 +23,8 @@ SELECT @@session.net_buffer_length;
 '#--------------------FN_DYNVARS_070_02-------------------------#'
 ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
 SET @@global.max_allowed_packet = 1024;
+Warnings:
+Warning	1708	The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
 SET @@global.net_buffer_length = 1024;
 SELECT @@global.max_allowed_packet;
 @@global.max_allowed_packet

=== modified file 'mysql-test/t/variables.test'
--- a/mysql-test/t/variables.test	2011-03-15 12:57:36 +0000
+++ b/mysql-test/t/variables.test	2011-03-25 12:55:22 +0000
@@ -1292,6 +1292,34 @@ SET @@global.max_join_size=DEFAULT;
 SET @@global.key_buffer_size=@kbs;
 SET @@global.key_cache_block_size=@kcbs;
 
+
+--echo #
+--echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET 
+--echo #   ARE NOT BEING HONORED
+--echo #
+
+CREATE TABLE t1 (a MEDIUMTEXT);
+
+SET GLOBAL max_allowed_packet=2048;
+SET GLOBAL net_buffer_length=4096;
+CONNECT (con1,localhost,root,,test);
+SHOW SESSION VARIABLES LIKE 'max_allowed_packet';
+SHOW SESSION VARIABLES LIKE 'net_buffer_length';
+--disable_query_log
+--error ER_NET_PACKET_TOO_LARGE
+INSERT INTO t1 VALUES ('1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234!
 5678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012!
 3456789012345678901234567890123456789012345678901234567890123456789012
34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901!
 2345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789!
 0123456789012345678901234567890123456789012345678901234567890123456789
01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678!
 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
+--enable_query_log
+--echo at this point the connection is disconnected by the server
+
+CONNECTION default;
+DISCONNECT con1;
+SELECT LENGTH(a) FROM t1;
+
+SET GLOBAL max_allowed_packet=default;
+SET GLOBAL net_buffer_length=default;
+DROP TABLE t1;
+
+
 --echo End of 5.1 tests
 
 ###########################################################################

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2011-03-15 12:57:36 +0000
+++ b/sql/mysqld.cc	2011-03-25 12:55:22 +0000
@@ -7282,6 +7282,14 @@ static int get_options(int *argc_ptr, ch
        opt_log_slow_slave_statements) &&
       !opt_slow_log)
     sql_print_warning("options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set");
+  if (global_system_variables.net_buffer_length > 
+      global_system_variables.max_allowed_packet)
+  {
+    sql_print_warning("net_buffer_length (%lu) is set to be larger "
+                      "than max_allowed_packet (%lu). Please rectify.",
+                      global_system_variables.net_buffer_length, 
+                      global_system_variables.max_allowed_packet);
+  }
 
   if (log_error_file_ptr != disabled_my_option)
     opt_error_log= 1;

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	2011-03-08 08:41:57 +0000
+++ b/sql/share/errmsg-utf8.txt	2011-03-25 12:55:22 +0000
@@ -6402,3 +6402,6 @@ ER_MULTI_UPDATE_KEY_CONFLICT
 # message as mysqlcheck parses the error message looking for ALTER TABLE.
 ER_TABLE_NEEDS_REBUILD
         eng "Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!"
+
+WARN_OPTION_BELOW_LIMIT
+  eng "The value of '%s' should be no less than the value of '%s'"

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2011-03-23 17:03:42 +0000
+++ b/sql/sys_vars.cc	2011-03-25 12:55:22 +0000
@@ -1030,13 +1030,32 @@ static bool session_readonly(sys_var *se
            self->name.str, "GLOBAL");
   return true;
 }
+
+static bool
+check_max_allowed_packet(sys_var *self, THD *thd,  set_var *var)
+{
+  longlong val;
+  if (session_readonly(self, thd, var))
+    return true;
+
+  val= var->save_result.ulonglong_value;
+  if (val < (longlong) global_system_variables.net_buffer_length)
+  {
+    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        WARN_OPTION_BELOW_LIMIT, ER(WARN_OPTION_BELOW_LIMIT),
+                        "max_allowed_packet", "net_buffer_length");
+  }
+  return false;
+}
+
+
 static Sys_var_ulong Sys_max_allowed_packet(
        "max_allowed_packet",
        "Max packet length to send to or receive from the server",
        SESSION_VAR(max_allowed_packet), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(1024, 1024*1024*1024), DEFAULT(1024*1024),
        BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG,
-       ON_CHECK(session_readonly));
+       ON_CHECK(check_max_allowed_packet));
 
 static Sys_var_ulonglong Sys_max_binlog_cache_size(
        "max_binlog_cache_size",
@@ -1267,12 +1286,29 @@ static Sys_var_mybool Sys_named_pipe(
        DEFAULT(FALSE));
 #endif
 
+
+static bool 
+check_net_buffer_length(sys_var *self, THD *thd,  set_var *var)
+{
+  longlong val;
+  if (session_readonly(self, thd, var))
+    return true;
+
+  val= var->save_result.ulonglong_value;
+  if (val > (longlong) global_system_variables.max_allowed_packet)
+  {
+    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        WARN_OPTION_BELOW_LIMIT, ER(WARN_OPTION_BELOW_LIMIT),
+                        "max_allowed_packet", "net_buffer_length");
+  }
+  return false;
+}
 static Sys_var_ulong Sys_net_buffer_length(
        "net_buffer_length",
        "Buffer length for TCP/IP and socket communication",
        SESSION_VAR(net_buffer_length), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(1024, 1024*1024), DEFAULT(16384), BLOCK_SIZE(1024),
-       NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(session_readonly));
+       NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_net_buffer_length));
 
 static bool fix_net_read_timeout(sys_var *self, THD *thd, enum_var_type type)
 {

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into mysql-5.5 branch (Georgi.Kodinov:3398) Bug#11766769Georgi Kodinov25 Mar