Commit 0e5e67e6 authored by hhunger@hh-nb.hungers's avatar hhunger@hh-nb.hungers

Eightth set of fixes for bug 35988.

parent a6ab8d9e
...@@ -3020,3 +3020,4 @@ win/vs8cache.txt ...@@ -3020,3 +3020,4 @@ win/vs8cache.txt
ylwrap ylwrap
zlib/*.ds? zlib/*.ds?
zlib/*.vcproj zlib/*.vcproj
mysql-test/r/max_allowed_packet_func.result
SET @save = @@global.group_concat_max_len;
drop table if exists t1;
## Creating new table t1 ##
CREATE TABLE t1
(
id INT NOT NULL auto_increment,
PRIMARY KEY (id),
rollno int NOT NULL,
name VARCHAR(30)
);
'#--------------------FN_DYNVARS_034_01-------------------------#'
## Setting initial value of variable to 4 ##
SET @@global.group_concat_max_len = 4;
## Inserting some rows in table ##
INSERT into t1(rollno, name) values(1, 'Record_1');
INSERT into t1(rollno, name) values(2, 'Record_2');
INSERT into t1(rollno, name) values(1, 'Record_3');
INSERT into t1(rollno, name) values(3, 'Record_4');
INSERT into t1(rollno, name) values(1, 'Record_5');
INSERT into t1(rollno, name) values(3, 'Record_6');
INSERT into t1(rollno, name) values(4, 'Record_7');
INSERT into t1(rollno, name) values(4, 'Record_8');
## Creating two new connections ##
'#--------------------FN_DYNVARS_034_02-------------------------#'
## Connecting with test_con1 ##
## Accessing data and using group_concat on column whose value is greater than 4 ##
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
id rollno group_concat(name)
1 1 Reco
2 2 Reco
4 3 Reco
7 4 Reco
Warnings:
Warning 1260 4 line(s) were cut by GROUP_CONCAT()
## Changing session value of variable and verifying its behavior, ##
## warning should come here ##
SET @@session.group_concat_max_len = 10;
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
id rollno group_concat(name)
1 1 Record_1,R
2 2 Record_2
4 3 Record_4,R
7 4 Record_7,R
Warnings:
Warning 1260 3 line(s) were cut by GROUP_CONCAT()
'#--------------------FN_DYNVARS_034_03-------------------------#'
## Connecting with new connection test_con2 ##
## Verifying initial value of variable. It should be 4 ##
SELECT @@session.group_concat_max_len = 4;
@@session.group_concat_max_len = 4
1
## Setting session value of variable to 20 and verifying variable is concating ##
## column's value to 20 or not ##
SET @@session.group_concat_max_len = 20;
## Verifying value of name column, it should not me more than 20 characters ##
## Warning should come here ##
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
id rollno group_concat(name)
1 1 Record_1,Record_3,Re
2 2 Record_2
4 3 Record_4,Record_6
7 4 Record_7,Record_8
Warnings:
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
'#--------------------FN_DYNVARS_034_04-------------------------#'
## Setting session value of variable to 26. No warning should appear here ##
## because the value after concatination is less than 30 ##
SET @@session.group_concat_max_len = 26;
## Verifying value of name column, it should not give warning now ##
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
id rollno group_concat(name)
1 1 Record_1,Record_3,Record_5
2 2 Record_2
4 3 Record_4,Record_6
7 4 Record_7,Record_8
## Dropping table t1 ##
DROP table t1;
## Disconnecting both the connection ##
SET @@group_concat_max_len = @save;
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
SET @ts_old = @@SESSION.timestamp; SET @ts_old = @@SESSION.timestamp;
waiting 1 sec waiting 1 sec
SET @ts_new = @@SESSION.timestamp; SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old AS 'Timestamp Difference'; SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
Timestamp Difference Timestamp Difference
1 1
1 Expected 1 means >=1 expected is true
** Connection con1 ** ** Connection con1 **
SET @ts_old = @@SESSION.timestamp; SET @ts_old = @@SESSION.timestamp;
waiting 4 sec waiting 4 sec
SET @ts_new = @@SESSION.timestamp; SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old AS 'Timestamp Difference'; SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
Timestamp Difference Timestamp Difference
4 1
4 Expected 1 means >=4 expected is true
'#-----------------------------FN_DYNVARS_179_02---------------------#' '#-----------------------------FN_DYNVARS_179_02---------------------#'
SET @ts_old = @@SESSION.timestamp; SET @ts_old = @@SESSION.timestamp;
Changing time zone Changing time zone
...@@ -27,7 +27,7 @@ SET @ts_new = @@SESSION.timestamp; ...@@ -27,7 +27,7 @@ SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference'; SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
Timestamp Difference Timestamp Difference
1 1
>=1 Expected 1 means >=1 expected is true
** Cleanup ** ** Cleanup **
** Connection default ** ** Connection default **
Disconnecting Connections con0, con1 Disconnecting Connections con0, con1
...@@ -19,3 +19,7 @@ ctype_create : Bug#32965 main.ctype_create fails ...@@ -19,3 +19,7 @@ ctype_create : Bug#32965 main.ctype_create fails
status : Bug#32966 main.status fails status : Bug#32966 main.status fails
ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
event_scheduler_basic: BUG#35997 server seems to crash.
event_scheduler_func: BUG#35997 server seems to crash.
thread_cache_size_func: BUG#35988 Due to not deterministic results
############## mysql-test\t\group_concat_max_len_func.test ####################
# #
# Variable Name: group_concat_max_len #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: numeric #
# Default Value: 1024 #
# Minimum value: 4 #
# #
# #
# Creation Date: 2008-03-07 #
# Author: Salman Rawala #
# #
# Description: Test Cases of Dynamic System Variable group_concat_max_len #
# that checks the functionality of this variable #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
SET @save = @@global.group_concat_max_len;
--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),
rollno int NOT NULL,
name VARCHAR(30)
);
--echo '#--------------------FN_DYNVARS_034_01-------------------------#'
########################################################################
# Setting initial value of group_concat_max_len, inserting some rows
# & creating 2 new connections
########################################################################
--echo ## Setting initial value of variable to 4 ##
SET @@global.group_concat_max_len = 4;
--echo ## Inserting some rows in table ##
INSERT into t1(rollno, name) values(1, 'Record_1');
INSERT into t1(rollno, name) values(2, 'Record_2');
INSERT into t1(rollno, name) values(1, 'Record_3');
INSERT into t1(rollno, name) values(3, 'Record_4');
INSERT into t1(rollno, name) values(1, 'Record_5');
INSERT into t1(rollno, name) values(3, 'Record_6');
INSERT into t1(rollno, name) values(4, 'Record_7');
INSERT into t1(rollno, name) values(4, 'Record_8');
--echo ## Creating two new connections ##
CONNECT (test_con1,localhost,root,,);
CONNECT (test_con2,localhost,root,,);
--echo '#--------------------FN_DYNVARS_034_02-------------------------#'
###############################################################################
# Verifying initial behavior of variable by concatinating values greater than 4
###############################################################################
--echo ## Connecting with test_con1 ##
CONNECTION test_con1;
--echo ## Accessing data and using group_concat on column whose value is greater than 4 ##
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
--echo ## Changing session value of variable and verifying its behavior, ##
--echo ## warning should come here ##
SET @@session.group_concat_max_len = 10;
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
--echo '#--------------------FN_DYNVARS_034_03-------------------------#'
##############################################################################
# Verifying behavior of variable by increasing session value of variable #
##############################################################################
--echo ## Connecting with new connection test_con2 ##
connection test_con2;
--echo ## Verifying initial value of variable. It should be 4 ##
SELECT @@session.group_concat_max_len = 4;
--echo ## Setting session value of variable to 20 and verifying variable is concating ##
--echo ## column's value to 20 or not ##
SET @@session.group_concat_max_len = 20;
--echo ## Verifying value of name column, it should not me more than 20 characters ##
--echo ## Warning should come here ##
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
--echo '#--------------------FN_DYNVARS_034_04-------------------------#'
###############################################################################
# Verifying behavior of variable by increasing session value of variable #
# greater than the maximum concat length of name column #
###############################################################################
--echo ## Setting session value of variable to 26. No warning should appear here ##
--echo ## because the value after concatination is less than 30 ##
SET @@session.group_concat_max_len = 26;
--echo ## Verifying value of name column, it should not give warning now ##
SELECT id, rollno, group_concat(name) FROM t1 GROUP BY rollno;
############################################################
# Disconnecting all connection & dropping table #
############################################################
--echo ## Dropping table t1 ##
DROP table t1;
--echo ## Disconnecting both the connection ##
DISCONNECT test_con2;
DISCONNECT test_con1;
connection default;
SET @@group_concat_max_len = @save;
################## 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
let $start_global_value = `SELECT @@global.max_allowed_packet`;
--echo $start_global_value
--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 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 @@session.max_allowed_packet = 1024;
SET @@session.net_buffer_length = 1024;
SELECT @@session.max_allowed_packet;
SELECT @@session.net_buffer_length;
--echo ## Inserting and fetching data of length greater than 1024 ##
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
SELECT length("aaaaaasssssssssssdddddddfffffgggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk") as len;
--echo ## Verifying record in table t1 ##
SELECT * from t1;
--echo 'Bug#35381: Error is not coming on inserting and fetching data of length'
--echo 'greater than max_allowed_packet size at session level';
--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;
--echo ## Creating new connection test_con1 ##
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;
eval SET @@global.max_allowed_packet = $start_global_value;
--echo ## Server disconnects after this case and error occurs that Server ##
--echo ## has gone away ##
...@@ -38,8 +38,8 @@ SET @ts_old = @@SESSION.timestamp; ...@@ -38,8 +38,8 @@ SET @ts_old = @@SESSION.timestamp;
--echo waiting 1 sec --echo waiting 1 sec
--sleep 1 --sleep 1
SET @ts_new = @@SESSION.timestamp; SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old AS 'Timestamp Difference'; SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
--echo 1 Expected --echo 1 means >=1 expected is true
# #
...@@ -51,8 +51,8 @@ SET @ts_old = @@SESSION.timestamp; ...@@ -51,8 +51,8 @@ SET @ts_old = @@SESSION.timestamp;
--echo waiting 4 sec --echo waiting 4 sec
--sleep 4 --sleep 4
SET @ts_new = @@SESSION.timestamp; SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old AS 'Timestamp Difference'; SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
--echo 4 Expected --echo 1 means >=4 expected is true
--echo '#-----------------------------FN_DYNVARS_179_02---------------------#' --echo '#-----------------------------FN_DYNVARS_179_02---------------------#'
# #
...@@ -65,7 +65,7 @@ SET @ts_old = @@SESSION.timestamp; ...@@ -65,7 +65,7 @@ SET @ts_old = @@SESSION.timestamp;
SET time_zone = 'MET'; SET time_zone = 'MET';
SET @ts_new = @@SESSION.timestamp; SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference'; SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
--echo >=1 Expected --echo 1 means >=1 expected is true
# #
# Cleanup # Cleanup
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment