From e5ae4e2392077508248637981d3276bae8a26e72 Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Thu, 20 Nov 2008 08:51:48 +0100 Subject: A fix for Bug#22891 "session level max_allowed_packet can be set but is ignored". This patch makes @@session.max_allowed_packed and @@session.net_buffer_length read-only as suggested in the bug report. The user will have to use SET GLOBAL (and reconnect) to alter the session values of these variables. The error string ER_VARIABLE_IS_READONLY is introduced. Tests are modified accordingly. sql/set_var.cc: The class sys_var_thd_ulong_session_readonly is introduced as a specialization of sys_var_thd_ulong implementing a read-only session variable. The class overrides check() and check_default() to achieve the read-only property for the session part of the variable. sql/set_var.h: The class sys_var_thd_ulong_session_readonly is introduced as a specialization of sys_var_thd_ulong implementing a read-only session variable. The class overrides check() and check_default() to achieve the read-only property for the session part of the variable. sql/share/errmsg.txt: New error ER_VARIABLE_IS_READONLY. --- mysql-test/t/union.test | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mysql-test/t/union.test') diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index f58cd54250b..ad4d57b7128 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -861,8 +861,10 @@ drop tables t1,t2,t3; # exceeds mediumtext maximum length # -SELECT @tmp_max:= @@max_allowed_packet; -SET max_allowed_packet=25000000; +SELECT @tmp_max:= @@global.max_allowed_packet; +SET @@global.max_allowed_packet=25000000; +# switching connection to allow the new max_allowed_packet take effect +--connect (newconn, localhost, root,,) CREATE TABLE t1 (a mediumtext); CREATE TABLE t2 (b varchar(20)); INSERT INTO t1 VALUES ('a'); @@ -884,7 +886,9 @@ INSERT INTO t1 VALUES ('a'); CREATE TABLE t3 SELECT REPEAT(a,2) AS a FROM t1 UNION SELECT b FROM t2; SHOW CREATE TABLE t3; DROP TABLES t1,t2,t3; -SET max_allowed_packet:= @tmp_max; +--connection default +SET @@global.max_allowed_packet:= @tmp_max; +--disconnect newconn # # Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM -- cgit v1.2.1