1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
# Tests that variables work correctly (setting and showing). This
# test is like the main.variables test, but for variables not
# available in embedded mode.
source include/not_embedded.inc;
--echo ---- Init ----
# Backup global variables so they can be restored at end of test.
set @my_slave_net_timeout =@@global.slave_net_timeout;
--echo ---- Test ----
set global slave_net_timeout=100;
set global sql_slave_skip_counter=100;
# End of 4.1 tests
# BUG #7800: Add various-slave related variables to SHOW VARIABLES
show variables like 'slave_compressed_protocol';
--replace_column 2 SLAVE_LOAD_TMPDIR
show variables like 'slave_load_tmpdir';
# We just set some arbitrary values in variables-master.opt so we can test
# that a list of values works correctly
show variables like 'slave_skip_errors';
--echo ---- Clean Up ----
set global slave_net_timeout=default;
# sql_slave_skip_counter is write-only, so we can't save previous
# value and restore it here. That's ok, because it's normally 0.
set global sql_slave_skip_counter= 0;
set @@global.slave_net_timeout= @my_slave_net_timeout;
#
# Bug#28234 - global/session scope - documentation vs implementation
#
--echo
#
# Additional variables fixed from sql_repl.cc.
#
--echo #
SHOW VARIABLES like 'log_slave_updates';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.log_slave_updates;
SELECT @@global.log_slave_updates;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.log_slave_updates= true;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.log_slave_updates= true;
#
--echo #
let $relay_prefix=`select concat(substring_index(@@relay_log,"-",1),"-")`;
--replace_result $relay_prefix XXX-
SHOW VARIABLES like 'relay_log';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log;
--replace_result $relay_prefix XXX-
SELECT @@global.relay_log;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.relay_log= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.relay_log= 'x';
#
--echo #
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $relay_prefix XXX-
SHOW VARIABLES like 'relay_log_basename';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_basename;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $relay_prefix XXX-
SELECT @@global.relay_log_basename;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.relay_log_basename= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.relay_log_basename= 'x';
#
--echo #
--replace_result $relay_prefix XXX-
SHOW VARIABLES like 'log_bin_basename';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.log_bin_basename;
--replace_result $relay_prefix XXX-
SELECT @@global.log_bin_basename;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.log_bin_basename= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.log_bin_basename= 'x';
#
--echo #
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $relay_prefix XXX-
SHOW VARIABLES like 'relay_log_index';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_index;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $relay_prefix XXX-
SELECT @@global.relay_log_index;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.relay_log_index= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.relay_log_index= 'x';
#
--echo #
--replace_result $relay_prefix XXX-
SHOW VARIABLES like 'log_bin_index';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.log_bin_index;
--replace_result $relay_prefix XXX-
SELECT @@global.log_bin_index;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.log_bin_index= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.log_bin_index= 'x';
#
--echo #
SHOW VARIABLES like 'relay_log_info_file';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_info_file;
SELECT @@global.relay_log_info_file;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.relay_log_info_file= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.relay_log_info_file= 'x';
#
--echo #
SHOW VARIABLES like 'relay_log_space_limit';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_space_limit;
SELECT @@global.relay_log_space_limit;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.relay_log_space_limit= 7;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.relay_log_space_limit= 7;
#
--echo #
--replace_column 2 #
SHOW VARIABLES like 'slave_load_tmpdir';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.slave_load_tmpdir;
--replace_column 1 #
SELECT @@global.slave_load_tmpdir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.slave_load_tmpdir= 'x';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.slave_load_tmpdir= 'x';
#
--echo #
SHOW VARIABLES like 'slave_skip_errors';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.slave_skip_errors;
SELECT @@global.slave_skip_errors;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.slave_skip_errors= 7;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.slave_skip_errors= 7;
#
--echo #
--echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET
--echo # ARE NOT BEING HONORED
--echo #
CREATE TABLE t1 (a MEDIUMTEXT);
set @save_max_allowed_packet=@@global.max_allowed_packet, @save_net_buffer_length=@@net_buffer_length;
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
#Sending a packet that is too big can result in either
#ER_NET_PACKET_TOO_LARGE or a socket error on the client side (2013= CR_SERVER_LOST)
#The server does not make any attempts to gracefully close client connection and ensuring
#client fully read the last packet. Server just closes the socket after it has send.
#Client thus can get either a socket error, or EOF, or an error packet with ER_NET_PACKET_TOO_LARGE
--error ER_NET_PACKET_TOO_LARGE,2013
INSERT INTO t1 VALUES ('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
--enable_query_log
CONNECTION default;
DISCONNECT con1;
SELECT LENGTH(a) FROM t1;
SET GLOBAL max_allowed_packet=@save_max_allowed_packet;
SET GLOBAL net_buffer_length=@save_net_buffer_length;
DROP TABLE t1;
--echo End of 5.1 tests
|