2670 Horst Hunger 2008-09-01
Fixed test programs to see how they behave in pushbuild.
added:
mysql-test/r/key_buffer_size_func.result
mysql-test/r/slow_launch_time_func.result
mysql-test/r/timestamp_func.result
mysql-test/r/wait_timeout_func.result
mysql-test/t/key_buffer_size_func.test
mysql-test/t/slow_launch_time_func.test
mysql-test/t/timestamp_func.test
mysql-test/t/wait_timeout_func.test
modified:
mysql-test/r/thread_cache_size_func.result
mysql-test/t/thread_cache_size_func.test
2669 Horst Hunger 2008-08-27
Modified test and inserted polling
added:
mysql-test/r/thread_cache_size_func.result
mysql-test/t/thread_cache_size_func.test
=== added file 'mysql-test/r/key_buffer_size_func.result'
--- a/mysql-test/r/key_buffer_size_func.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/key_buffer_size_func.result 2008-09-01 20:47:12 +0000
@@ -0,0 +1,36 @@
+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)
+);
+FLUSH STATUS;
+'#--------------------FN_DYNVARS_055_01-------------------------#'
+## Setting initial value of variable to 131072 ##
+SET @@global.key_buffer_size = 131072;
+## Creating two new connections ##
+'#--------------------FN_DYNVARS_055_02-------------------------#'
+## Connecting with connection test_con1 ##
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+131072
+## 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');
+INSERT into t1(rollno, name) values(4, 'Record_9');
+INSERT into t1(rollno, name) values(4, 'Record_10');
+## Verifying status of reading & writing variables ##
+## Switching to connection test_con2 ##
+## Verifying status of reading & writing variables ##
+## Dropping table ##
+DROP table if exists t1;
+## Disconnecting both the connections ##
=== added file 'mysql-test/r/slow_launch_time_func.result'
--- a/mysql-test/r/slow_launch_time_func.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/slow_launch_time_func.result 2008-09-01 20:47:12 +0000
@@ -0,0 +1,37 @@
+SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
+'#--------------------FN_DYNVARS_124_01-------------------------#'
+** Connection default **
+SET @@GLOBAL.slow_launch_time=0;
+SELECT @@GLOBAL.slow_launch_time;
+@@GLOBAL.slow_launch_time
+0
+** Connecting conn5 using username 'root' **
+** Connecting conn6 using username 'root' **
+** Connecting conn7 using username 'root' **
+** Connecting conn8 using username 'root' **
+** Connecting conn9 using username 'root' **
+** Connecting conn10 using username 'root' **
+** Connecting conn11 using username 'root' **
+** Connecting conn12 using username 'root' **
+** Connecting conn13 using username 'root' **
+** Connecting conn14 using username 'root' **
+** Connecting conn15 using username 'root' **
+** Connecting conn16 using username 'root' **
+show status like 'slow_launch_threads';
+Variable_name Value
+Slow_launch_threads 12
+12 Expected
+** Connection default **
+** Disconnecting conn5 **
+** Disconnecting conn6 **
+** Disconnecting conn7 **
+** Disconnecting conn8 **
+** Disconnecting conn9 **
+** Disconnecting conn10 **
+** Disconnecting conn11 **
+** Disconnecting conn12 **
+** Disconnecting conn13 **
+** Disconnecting conn14 **
+** Disconnecting conn15 **
+** Disconnecting conn16 **
+SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
=== modified file 'mysql-test/r/thread_cache_size_func.result'
--- a/mysql-test/r/thread_cache_size_func.result 2008-08-27 11:09:40 +0000
+++ b/mysql-test/r/thread_cache_size_func.result 2008-09-01 20:47:12 +0000
@@ -8,14 +8,26 @@ Threads_cached 0
0 Expected
'#Old value for thread_cache'#
** Connecting conn1 using username 'root' **
+SELECT 1 as 'dummy result';
+dummy result
+1
** Connecting conn2 using username 'root' **
+SELECT 2 as 'dummy result';
+dummy result
+2
** Connecting conn3 using username 'root' **
+SELECT 3 as 'dummy result';
+dummy result
+3
** Connecting conn4 using username 'root' **
+SELECT 4 as 'dummy result';
+dummy result
+4
+** Connection default **
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 0
0 Expected
-** Connection default **
** Disconnecting conn1,conn2,conn3,conn4 **
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
@@ -23,8 +35,14 @@ Threads_cached 3
3 Expected
SET @@GLOBAL.thread_cache_size= 1;
** Connecting conn1 using username 'root' **
+SELECT 1 as 'dummy result';
+dummy result
+1
** Connecting conn2 using username 'root' **
-** Connection default **
+SELECT 2 as 'dummy result';
+dummy result
+2
+connection default;
** Disconnecting conn1,conn2 **
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
=== added file 'mysql-test/r/timestamp_func.result'
--- a/mysql-test/r/timestamp_func.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/timestamp_func.result 2008-09-01 20:47:12 +0000
@@ -0,0 +1,25 @@
+** Connecting con1 using root **
+SELECT date(now()) = date(sysdate());
+date(now()) = date(sysdate())
+1
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+1
+** Connecting con0 using root **
+SELECT @@session.timestamp != 1100000000;
+@@session.timestamp != 1100000000
+1
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+1
+** Connection con1 **
+SELECT @@session.timestamp != 1000000000;
+@@session.timestamp != 1000000000
+1
+SELECT @@session.timestamp = 1100000000;
+@@session.timestamp = 1100000000
+1
+** Connection default **
+Disconnecting Connections con0, con1
=== added file 'mysql-test/r/wait_timeout_func.result'
--- a/mysql-test/r/wait_timeout_func.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/wait_timeout_func.result 2008-09-01 20:47:12 +0000
@@ -0,0 +1,21 @@
+SET @start_value= @@global.wait_timeout;
+'#--------------------FN_DYNVARS_186_01-------------------------#'
+SET @start_time= CURTIME();
+connect (test_con1, localhost, root,,);
+SET @@session.wait_timeout = 2;
+connect (test_con2, localhost, root,,);
+SET @@session.wait_timeout = 1;
+SELECT info FROM information_schema.processlist;
+info
+SELECT info FROM information_schema.processlist
+'#--------------------FN_DYNVARS_186_03-------------------------#'
+SET @@global.wait_timeout = 2;
+connect (test_con3, localhost, root,,);
+connection default;
+SELECT info FROM information_schema.processlist;
+info
+SELECT info FROM information_schema.processlist
+SELECT TIMEDIFF(@start_time,CURTIME()) >= 4;
+TIMEDIFF(@start_time,CURTIME()) >= 4
+1
+SET @@global.wait_timeout= @start_value;
=== added file 'mysql-test/t/key_buffer_size_func.test'
--- a/mysql-test/t/key_buffer_size_func.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/key_buffer_size_func.test 2008-09-01 20:47:12 +0000
@@ -0,0 +1,100 @@
+################### mysql-test\t\key_buffer_size_func.test ####################
+# #
+# Variable Name: key_buffer_size #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value: 131072 #
+# Range:8-4294967295 #
+# #
+# #
+# Creation Date: 2008-03-07 #
+# Author: Salman Rawala #
+# #
+# Description: Test Cases of Dynamic System Variable key_buffer_size #
+# that checks the functionality of this variable #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
+# server-system-variables.html #
+# #
+###############################################################################
+
+--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)
+);
+
+FLUSH STATUS;
+
+--echo '#--------------------FN_DYNVARS_055_01-------------------------#'
+########################################################################
+# Setting initial value of key_buffer_size, inserting some rows
+# & creating 2 new connections
+########################################################################
+
+--echo ## Setting initial value of variable to 131072 ##
+SET @@global.key_buffer_size = 131072;
+
+
+--echo ## Creating two new connections ##
+CONNECT (test_con1,localhost,root,,);
+CONNECT (test_con2,localhost,root,,);
+
+
+--echo '#--------------------FN_DYNVARS_055_02-------------------------#'
+###############################################################################
+# Verifying initial behavior of variable by concatinating values greater than 4
+###############################################################################
+
+--echo ## Connecting with connection test_con1 ##
+CONNECTION test_con1;
+SELECT @@global.key_buffer_size;
+
+
+--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');
+INSERT into t1(rollno, name) values(4, 'Record_9');
+INSERT into t1(rollno, name) values(4, 'Record_10');
+
+--echo ## Verifying status of reading & writing variables ##
+# Disabled due to differences in results
+#show status like 'Key%';
+
+--echo ## Switching to connection test_con2 ##
+connection test_con2;
+
+--echo ## Verifying status of reading & writing variables ##
+# Disabled due to differences in results
+#show status like 'Key%';
+
+############################################################
+# Disconnecting all connection & dropping table #
+############################################################
+
+--echo ## Dropping table ##
+DROP table if exists t1;
+
+--echo ## Disconnecting both the connections ##
+DISCONNECT test_con2;
+DISCONNECT test_con1;
+
+
=== added file 'mysql-test/t/slow_launch_time_func.test'
--- a/mysql-test/t/slow_launch_time_func.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/slow_launch_time_func.test 2008-09-01 20:47:12 +0000
@@ -0,0 +1,112 @@
+############# mysql-test\t\SLOW_LAUNCH_time_func.test ##########################
+# #
+# Variable Name: slow_launch_time # # Scope: SESSION #
+# Access Type: Dynamic #
+# Data Type: NUMERIC #
+# Default Value: 2 #
+# Values: - #
+# #
+# #
+# Creation Date: 2008-03-02 #
+# Author: Sharique Abdullah #
+# Modified: HHunger 2008-08-29 Polling until all connect ready. #
+# #
+# Description: Test Cases of Dynamic System Variable "slow_launch_time " #
+# that checks behavior of this variable in the following ways #
+# * Functionality based on different values #
+# #
+# Reference: #
+# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
+# #
+################################################################################
+
+#
+# Setup
+#
+
+--source include/not_embedded.inc
+
+SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
+
+
+--echo '#--------------------FN_DYNVARS_124_01-------------------------#'
+
+#####################################
+# Increase number of connection #
+#####################################
+
+--echo ** Connection default **
+connection default;
+
+SET @@GLOBAL.slow_launch_time=0;
+SELECT @@GLOBAL.slow_launch_time;
+
+--echo ** Connecting conn5 using username 'root' **
+CONNECT (conn5,localhost,root,,);
+--echo ** Connecting conn6 using username 'root' **
+CONNECT (conn6,localhost,root,,);
+--echo ** Connecting conn7 using username 'root' **
+CONNECT (conn7,localhost,root,,);
+--echo ** Connecting conn8 using username 'root' **
+CONNECT (conn8,localhost,root,,);
+--echo ** Connecting conn9 using username 'root' **
+CONNECT (conn9,localhost,root,,);
+--echo ** Connecting conn10 using username 'root' **
+CONNECT (conn10,localhost,root,,);
+--echo ** Connecting conn11 using username 'root' **
+CONNECT (conn11,localhost,root,,);
+--echo ** Connecting conn12 using username 'root' **
+CONNECT (conn12,localhost,root,,);
+--echo ** Connecting conn13 using username 'root' **
+CONNECT (conn13,localhost,root,,);
+--echo ** Connecting conn14 using username 'root' **
+CONNECT (conn14,localhost,root,,);
+--echo ** Connecting conn15 using username 'root' **
+CONNECT (conn15,localhost,root,,);
+--echo ** Connecting conn16 using username 'root' **
+CONNECT (conn16,localhost,root,,);
+
+let $wait_condition= SELECT COUNT(*) = 13 FROM information_schema.processlist;
+--source include/wait_condition.inc
+
+#
+# Checking status of slow_launch_threads
+#
+
+show status like 'slow_launch_threads';
+--echo 12 Expected
+
+#
+# Cleanup
+#
+
+--echo ** Connection default **
+connection default;
+
+--echo ** Disconnecting conn5 **
+disconnect conn5;
+--echo ** Disconnecting conn6 **
+disconnect conn6;
+--echo ** Disconnecting conn7 **
+disconnect conn7;
+--echo ** Disconnecting conn8 **
+disconnect conn8;
+--echo ** Disconnecting conn9 **
+disconnect conn9;
+--echo ** Disconnecting conn10 **
+disconnect conn10;
+--echo ** Disconnecting conn11 **
+disconnect conn11;
+--echo ** Disconnecting conn12 **
+disconnect conn12;
+--echo ** Disconnecting conn13 **
+disconnect conn13;
+--echo ** Disconnecting conn14 **
+disconnect conn14;
+--echo ** Disconnecting conn15 **
+disconnect conn15;
+--echo ** Disconnecting conn16 **
+disconnect conn16;
+
+SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
+
=== modified file 'mysql-test/t/thread_cache_size_func.test'
--- a/mysql-test/t/thread_cache_size_func.test 2008-08-27 11:09:40 +0000
+++ b/mysql-test/t/thread_cache_size_func.test 2008-09-01 20:47:12 +0000
@@ -48,17 +48,24 @@ SHOW STATUS LIKE 'Threads_cached';
##################################
--echo ** Connecting conn1 using username 'root' **
-connect (conn1,localhost,root,,);
+CONNECT (conn1,localhost,root,,);
+SELECT 1 as 'dummy result';
--echo ** Connecting conn2 using username 'root' **
-connect (conn2,localhost,root,,);
+CONNECT (conn2,localhost,root,,);
+SELECT 2 as 'dummy result';
--echo ** Connecting conn3 using username 'root' **
-connect (conn3,localhost,root,,);
+CONNECT (conn3,localhost,root,,);
+SELECT 3 as 'dummy result';
--echo ** Connecting conn4 using username 'root' **
-connect (conn4,localhost,root,,);
+CONNECT (conn4,localhost,root,,);
+SELECT 4 as 'dummy result';
+
+--echo ** Connection default **
+CONNECTION default;
# Wait until all connections done
-let $wait_condition= SELECT COUNT(*)= 5 FROM INFORMATION_SCHEMA.PROCESSLIST;
---source include/wait_condition.inc
+#let $wait_condition= SELECT COUNT(*)= 5 FROM INFORMATION_SCHEMA.PROCESSLIST;
+#--source include/wait_condition.inc
SHOW STATUS LIKE 'Threads_cached';
--echo 0 Expected
@@ -67,14 +74,11 @@ SHOW STATUS LIKE 'Threads_cached';
#Disconnecting all the connections #
####################################
---echo ** Connection default **
-connection default;
-
--echo ** Disconnecting conn1,conn2,conn3,conn4 **
-disconnect conn1;
-disconnect conn2;
-disconnect conn3;
-disconnect conn4;
+DISCONNECT conn1;
+DISCONNECT conn2;
+DISCONNECT conn3;
+DISCONNECT conn4;
#
# Checking the status
@@ -92,23 +96,23 @@ SHOW STATUS LIKE 'Threads_cached';
#
SET @@GLOBAL.thread_cache_size= 1;
-connection default;
-
--echo ** Connecting conn1 using username 'root' **
CONNECT (conn1,localhost,root,,);
+SELECT 1 as 'dummy result';
--echo ** Connecting conn2 using username 'root' **
CONNECT (conn2,localhost,root,,);
+SELECT 2 as 'dummy result';
-# Wait until all connects ready
-let $wait_condition= SELECT COUNT(*)= 3 FROM INFORMATION_SCHEMA.PROCESSLIST;
---source include/wait_condition.inc
+--echo connection default;
+CONNECTION default;
---echo ** Connection default **
-connection default;
+# Wait until all connects ready
+#let $wait_condition= SELECT COUNT(*)= 3 FROM INFORMATION_SCHEMA.PROCESSLIST;
+#--source include/wait_condition.inc
--echo ** Disconnecting conn1,conn2 **
-disconnect conn1;
-disconnect conn2;
+DISCONNECT conn1;
+DISCONNECT conn2;
# Wait until all disconnects ready
let $wait_condition= SELECT COUNT(*)= 1 FROM INFORMATION_SCHEMA.PROCESSLIST;
=== added file 'mysql-test/t/timestamp_func.test'
--- a/mysql-test/t/timestamp_func.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/timestamp_func.test 2008-09-01 20:47:12 +0000
@@ -0,0 +1,49 @@
+############# mysql-test\t\timestamp_func.test #############################
+# #
+# Variable Name: timestamp #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: INTEGER #
+# #
+# #
+# Creation Date: 2008-02-25 #
+# Author: Sharique Abdullah #
+# #
+# Modified: HHunger 2008-08-28 Reimplemented the test completely. #
+# #
+# Description: Test Cases of Dynamic System Variable "timestamp" #
+# that checks behavior of this variable in the following ways #
+# * Functionality based on different values #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
+# #
+############################################################################
+
+# Change timestamp which must have an effect on now(), but not on sysdate().
+# Use Unix epoch timestamp
+# All comparisons must deliver true(1)
+
+--echo ** Connecting con1 using root **
+connect (con1,localhost,root,,);
+SELECT date(now()) = date(sysdate());
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+
+# Assure that setting of the variable has no effect on other session.
+--echo ** Connecting con0 using root **
+connect (con0,localhost,root,,);
+SELECT @@session.timestamp != 1100000000;
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+
+--echo ** Connection con1 **
+connection con1;
+SELECT @@session.timestamp != 1000000000;
+SELECT @@session.timestamp = 1100000000;
+
+--echo ** Connection default **
+connection default;
+--echo Disconnecting Connections con0, con1
+disconnect con0;
+disconnect con1;
+
=== added file 'mysql-test/t/wait_timeout_func.test'
--- a/mysql-test/t/wait_timeout_func.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/wait_timeout_func.test 2008-09-01 20:47:12 +0000
@@ -0,0 +1,70 @@
+############## mysql-test\t\wait_timeout_func.test ############################
+# #
+# Variable Name: wait_timeout #
+# Scope: GLOBAL | SESSION #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value: #
+# Range: #
+# #
+# #
+# Creation Date: 2008-03-07 #
+# Author: Salman Rawala #
+# #
+# Modified: HHunger 2008-08-27 Simplified the test and replaced the sleeps. #
+# #
+# Description: Test Cases of Dynamic System Variable wait_timeout #
+# that checks the functionality of this variable #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
+# server-system-variables.html#option_mysqld_wait_timeouts #
+# #
+###############################################################################
+
+--source include/not_embedded.inc
+
+SET @start_value= @@global.wait_timeout;
+
+--echo '#--------------------FN_DYNVARS_186_01-------------------------#'
+#######################################################################
+# 1. test of scope session
+#######################################################################
+
+SET @start_time= CURTIME();
+--echo connect (test_con1, localhost, root,,);
+connect (test_con1, localhost, root,,);
+connection test_con1;
+
+SET @@session.wait_timeout = 2;
+
+--echo connect (test_con2, localhost, root,,);
+connect (test_con2, localhost, root,,);
+connection test_con2;
+
+SET @@session.wait_timeout = 1;
+
+connection default;
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
+--source include/wait_condition.inc
+SELECT info FROM information_schema.processlist;
+
+--echo '#--------------------FN_DYNVARS_186_03-------------------------#'
+#######################################################################
+# 2. test of scope global
+#######################################################################
+
+SET @@global.wait_timeout = 2;
+
+--echo connect (test_con3, localhost, root,,);
+connect (test_con3, localhost, root,,);
+connection test_con3;
+
+--echo connection default;
+connection default;
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
+--source include/wait_condition.inc
+SELECT info FROM information_schema.processlist;
+
+SELECT TIMEDIFF(@start_time,CURTIME()) >= 4;
+SET @@global.wait_timeout= @start_value;
+
| Thread |
|---|
| • bzr push into mysql-5.1 branch (horst:2669 to 2670) | Horst Hunger | 3 Sep |