mariadb/mysql-test/r/max_allowed_packet_basic.result
Staale Smedseng e60c8c8b68 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.
2008-11-20 08:51:48 +01:00

190 lines
7.5 KiB
Text

SET @start_global_value = @@global.max_allowed_packet;
SELECT @start_global_value;
@start_global_value
1048576
SET @@global.max_allowed_packet = DEFAULT;
'#--------------------FN_DYNVARS_070_01-------------------------#'
SET @@global.max_allowed_packet = 1000;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '1000'
SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 20000;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SET @@session.max_allowed_packet = DEFAULT;
ERROR 42000: Variable 'max_allowed_packet' doesn't have a default value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
'#--------------------FN_DYNVARS_070_02-------------------------#'
SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet = 1048576;
@@global.max_allowed_packet = 1048576
1
'#--------------------FN_DYNVARS_070_03-------------------------#'
SET @@global.max_allowed_packet = 1024;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = 1025;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
: 'Bug# 34841: "Invalid values are coming in variable on assigning valid value';
SET @@global.max_allowed_packet = 1073741824;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
SET @@global.max_allowed_packet = 1073741823;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073740800
'#--------------------FN_DYNVARS_070_04-------------------------#'
SET @@session.max_allowed_packet = 1024;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 1025;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 65535;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 1073741824;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 1073741823;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
'#------------------FN_DYNVARS_070_05-----------------------#'
SET @@global.max_allowed_packet = 0;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '0'
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: '0'
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'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = 10737418241;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '10737418241'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
SET @@global.max_allowed_packet = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
SET @@global.max_allowed_packet = test;
ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
SET @@session.max_allowed_packet = 0;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 1023;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
SET @@session.max_allowed_packet = -2;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
SET @@session.max_allowed_packet = 65530.34.;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
SET @@session.max_allowed_packet = 10737418241;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
'Bug # 34837: Errors are not coming on assigning invalid values to variable';
SET @@session.max_allowed_packet = test;
ERROR 42000: Incorrect argument type to variable 'max_allowed_packet'
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576
'#------------------FN_DYNVARS_070_06-----------------------#'
SELECT @@global.max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='max_allowed_packet';
@@global.max_allowed_packet = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_070_07-----------------------#'
SELECT @@session.max_allowed_packet = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='max_allowed_packet';
@@session.max_allowed_packet = VARIABLE_VALUE
1
'#------------------FN_DYNVARS_070_08-----------------------#'
SET @@global.max_allowed_packet = TRUE;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '1'
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'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
'#---------------------FN_DYNVARS_070_09----------------------#'
SET @@global.max_allowed_packet = 2048;
SELECT @@max_allowed_packet = @@global.max_allowed_packet;
@@max_allowed_packet = @@global.max_allowed_packet
0
'#---------------------FN_DYNVARS_070_10----------------------#'
SET @@max_allowed_packet = 100000;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@max_allowed_packet = @@local.max_allowed_packet;
@@max_allowed_packet = @@local.max_allowed_packet
1
SELECT @@local.max_allowed_packet = @@session.max_allowed_packet;
@@local.max_allowed_packet = @@session.max_allowed_packet
1
'#---------------------FN_DYNVARS_070_11----------------------#'
SET max_allowed_packet = 1024;
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
SELECT @@max_allowed_packet;
@@max_allowed_packet
1048576
SELECT local.max_allowed_packet;
ERROR 42S02: Unknown table 'local' in field list
SELECT session.max_allowed_packet;
ERROR 42S02: Unknown table 'session' in field list
SELECT max_allowed_packet = @@session.max_allowed_packet;
ERROR 42S22: Unknown column 'max_allowed_packet' in 'field list'
SET @@global.max_allowed_packet = @start_global_value;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1048576
SELECT @@session.max_allowed_packet;
@@session.max_allowed_packet
1048576