summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <hhunger@hh-nb.hungers>2008-04-23 11:36:17 +0200
committerunknown <hhunger@hh-nb.hungers>2008-04-23 11:36:17 +0200
commit9fd9785a4a166d1ac33b9c0901bbf47724cc66a6 (patch)
tree14426059569bec3951324fca16819e04e762f54d
parentd526b7523f1fc0122ad24cd8e9425035d02feb54 (diff)
downloadmariadb-git-9fd9785a4a166d1ac33b9c0901bbf47724cc66a6.tar.gz
Eightth set of fixes for bug 35988.
BitKeeper/etc/ignore: Added mysql-test/r/max_allowed_packet_func.result to the ignore list
-rw-r--r--.bzrignore1
-rw-r--r--mysql-test/r/group_concat_max_len_func.result79
-rw-r--r--mysql-test/r/timestamp_func.result12
-rw-r--r--mysql-test/t/disabled.def4
-rw-r--r--mysql-test/t/group_concat_max_len_func.test131
-rw-r--r--mysql-test/t/max_allowed_packet_func.test95
-rw-r--r--mysql-test/t/timestamp_func.test10
7 files changed, 321 insertions, 11 deletions
diff --git a/.bzrignore b/.bzrignore
index 25af8360a83..9ef8bc64f80 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -3020,3 +3020,4 @@ win/vs8cache.txt
ylwrap
zlib/*.ds?
zlib/*.vcproj
+mysql-test/r/max_allowed_packet_func.result
diff --git a/mysql-test/r/group_concat_max_len_func.result b/mysql-test/r/group_concat_max_len_func.result
new file mode 100644
index 00000000000..4ec07c989b7
--- /dev/null
+++ b/mysql-test/r/group_concat_max_len_func.result
@@ -0,0 +1,79 @@
+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;
diff --git a/mysql-test/r/timestamp_func.result b/mysql-test/r/timestamp_func.result
index c41db55cae6..ed51cec4227 100644
--- a/mysql-test/r/timestamp_func.result
+++ b/mysql-test/r/timestamp_func.result
@@ -7,18 +7,18 @@
SET @ts_old = @@SESSION.timestamp;
waiting 1 sec
SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old AS 'Timestamp Difference';
+SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
Timestamp Difference
1
-1 Expected
+1 means >=1 expected is true
** Connection con1 **
SET @ts_old = @@SESSION.timestamp;
waiting 4 sec
SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old AS 'Timestamp Difference';
+SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
Timestamp Difference
-4
-4 Expected
+1
+1 means >=4 expected is true
'#-----------------------------FN_DYNVARS_179_02---------------------#'
SET @ts_old = @@SESSION.timestamp;
Changing time zone
@@ -27,7 +27,7 @@ SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
Timestamp Difference
1
->=1 Expected
+1 means >=1 expected is true
** Cleanup **
** Connection default **
Disconnecting Connections con0, con1
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 89979ef8dee..afbccbf0af1 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -19,3 +19,7 @@ ctype_create : Bug#32965 main.ctype_create fails
status : Bug#32966 main.status fails
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
+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
+
diff --git a/mysql-test/t/group_concat_max_len_func.test b/mysql-test/t/group_concat_max_len_func.test
new file mode 100644
index 00000000000..1c581d16aa3
--- /dev/null
+++ b/mysql-test/t/group_concat_max_len_func.test
@@ -0,0 +1,131 @@
+############## 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;
+
diff --git a/mysql-test/t/max_allowed_packet_func.test b/mysql-test/t/max_allowed_packet_func.test
new file mode 100644
index 00000000000..37ca15f85f0
--- /dev/null
+++ b/mysql-test/t/max_allowed_packet_func.test
@@ -0,0 +1,95 @@
+################## 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 ##
+
+
diff --git a/mysql-test/t/timestamp_func.test b/mysql-test/t/timestamp_func.test
index 84c66441e6f..ecca3c7daeb 100644
--- a/mysql-test/t/timestamp_func.test
+++ b/mysql-test/t/timestamp_func.test
@@ -38,8 +38,8 @@ SET @ts_old = @@SESSION.timestamp;
--echo waiting 1 sec
--sleep 1
SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old AS 'Timestamp Difference';
---echo 1 Expected
+SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
+--echo 1 means >=1 expected is true
#
@@ -51,8 +51,8 @@ SET @ts_old = @@SESSION.timestamp;
--echo waiting 4 sec
--sleep 4
SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old AS 'Timestamp Difference';
---echo 4 Expected
+SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
+--echo 1 means >=4 expected is true
--echo '#-----------------------------FN_DYNVARS_179_02---------------------#'
#
@@ -65,7 +65,7 @@ SET @ts_old = @@SESSION.timestamp;
SET time_zone = 'MET';
SET @ts_new = @@SESSION.timestamp;
SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
---echo >=1 Expected
+--echo 1 means >=1 expected is true
#
# Cleanup