blob: d60c10a1a3388bd0bc16755495f7021a7aa2a114 (
plain)
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
|
################## mysql-test\t\max_allowed_packet_func.test ##################
# #
# Variable Name: max_allowed_packet #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value:1048576 #
# Range:1024-1073741824 #
# #
# #
# Creation Date: 2008-03-07 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable max_allowed_packet #
# that checks the functionality of this variable #
# #
# Reference: #
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
# #
###############################################################################
#due to lost connection on win64
--source include/not_windows.inc
SET @start_max_allowed_packet= @@global.max_allowed_packet;
SET @start_value= @@global.net_buffer_length;
--disable_warnings
drop table if exists t1;
--enable_warnings
#########################
# Creating new table #
#########################
--echo ## Creating new table t1 ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
name BLOB
);
--echo '#--------------------FN_DYNVARS_070_01-------------------------#'
###############################################################################
# Setting initial value of max_allowed_packet to 1024 at session level
# should result in an error (session variable is readonly)
###############################################################################
--echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
--error ER_VARIABLE_IS_READONLY
SET @@session.max_allowed_packet = 1024;
SELECT @@session.max_allowed_packet > 0;
--error ER_VARIABLE_IS_READONLY
SET @@session.net_buffer_length = 1024;
SELECT @@session.net_buffer_length > 0;
--echo '#--------------------FN_DYNVARS_070_02-------------------------#'
###############################################################################
# Setting value of max_allowed_packet to 1024 at global level and
# verifying its behavior after inserting data greater than 1024 bytes
###############################################################################
--echo ## Setting value of max_allowed packet and net_buffer_length to 1024 ##
SET @@global.max_allowed_packet = 1024;
SET @@global.net_buffer_length = 1024;
SELECT @@global.max_allowed_packet;
SELECT @@global.net_buffer_length;
connect (test_con1,localhost,root,,);
connection test_con1;
--echo ## Inserting and fetching data of length greater than 1024 ##
--Error 0,ER_NET_PACKET_TOO_LARGE
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
disconnect test_con1;
connection default;
drop table t1;
SET @@global.max_allowed_packet= @start_max_allowed_packet;
SET @@global.net_buffer_length= @start_value;
|