List:Commits« Previous MessageNext Message »
From:Horst Hunger Date:September 12 2008 2:52pm
Subject:bzr commit into mysql-5.1 branch (horst:2675)
View as plain text  
#At file:///work/bzr/mysql-5.1-serverqa/

 2675 Horst Hunger	2008-09-12
      Push for running new tests in pushbuild.
modified:
  mysql-test/r/slow_launch_time_func.result
  mysql-test/r/thread_cache_size_func.result
  mysql-test/r/wait_timeout_func.result
  mysql-test/t/slow_launch_time_func.test
  mysql-test/t/thread_cache_size_func.test
  mysql-test/t/wait_timeout_func.test

=== modified file 'mysql-test/r/slow_launch_time_func.result'
--- a/mysql-test/r/slow_launch_time_func.result	2008-09-01 20:47:12 +0000
+++ b/mysql-test/r/slow_launch_time_func.result	2008-09-12 12:52:17 +0000
@@ -1,37 +1,17 @@
 SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
-'#--------------------FN_DYNVARS_124_01-------------------------#'
 ** Connection default **
+'#--------------------FN_DYNVARS_124_01-------------------------#'
 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 **
+** Connecting conn1 using username 'root' **
+** Switch to connection default and disconnect conn1 **
+'#--------------------FN_DYNVARS_124_02-------------------------#'
+SET @@GLOBAL.slow_launch_time= 1000;
+SELECT @@GLOBAL.slow_launch_time;
+@@GLOBAL.slow_launch_time
+1000
+** Connecting conn2 using username 'root' **
+** Switch to connection default and disconnect conn2 **
 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-09-01 20:47:12 +0000
+++ b/mysql-test/r/thread_cache_size_func.result	2008-09-12 12:52:17 +0000
@@ -6,23 +6,10 @@ SHOW STATUS LIKE 'Threads_cached';
 Variable_name	Value
 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
@@ -35,13 +22,7 @@ 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' **
-SELECT 2 as 'dummy result';
-dummy result
-2
 connection default;
 ** Disconnecting conn1,conn2 **
 SHOW STATUS LIKE 'Threads_cached';

=== modified file 'mysql-test/r/wait_timeout_func.result'
--- a/mysql-test/r/wait_timeout_func.result	2008-09-01 20:47:12 +0000
+++ b/mysql-test/r/wait_timeout_func.result	2008-09-12 12:52:17 +0000
@@ -2,20 +2,31 @@ SET @start_value= @@global.wait_timeout;
 '#--------------------FN_DYNVARS_186_01-------------------------#'
 SET @start_time= CURTIME();
 connect (test_con1, localhost, root,,);
-SET @@session.wait_timeout = 2;
+SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
+Expect 1
+1
+SET @@session.wait_timeout = <session_value>;
 connect (test_con2, localhost, root,,);
-SET @@session.wait_timeout = 1;
+SET @@session.wait_timeout = <session_value> - 1;
+connection default;
+wait until connections ready
 SELECT info FROM information_schema.processlist;
 info
 SELECT info FROM information_schema.processlist
 '#--------------------FN_DYNVARS_186_03-------------------------#'
-SET @@global.wait_timeout = 2;
+SET @@global.wait_timeout= <global_value>;
+SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
+Expect 1
+1
 connect (test_con3, localhost, root,,);
+SELECT @@session.wait_timeout = <session_value> AS 'Expect 1';
+Expect 1
+0
 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
+SELECT TIMEDIFF(@start_time,CURTIME()) >= <global_value> +
<session_value>;;
+TIMEDIFF(@start_time,CURTIME()) >= <global_value> + <session_value>;
 1
 SET @@global.wait_timeout= @start_value;

=== modified file 'mysql-test/t/slow_launch_time_func.test'
--- a/mysql-test/t/slow_launch_time_func.test	2008-09-01 20:47:12 +0000
+++ b/mysql-test/t/slow_launch_time_func.test	2008-09-12 12:52:17 +0000
@@ -1,6 +1,7 @@
-############# mysql-test\t\SLOW_LAUNCH_time_func.test ##########################
+############# mysql-test\t\slow_launch_time_func.test ##########################
 #                                                                              #
-# Variable Name: slow_launch_time                                              #  #
Scope: SESSION                                                               #
+# Variable Name: slow_launch_time                                              #
+# Scope: SESSION                                                               #
 # Access Type: Dynamic                                                         #
 # Data Type: NUMERIC                                                           #
 # Default Value: 2                                                             #
@@ -9,14 +10,19 @@
 #                                                                              #
 # Creation Date: 2008-03-02                                                    #
 # Author:  Sharique Abdullah                                                   #
-# Modified: HHunger 2008-08-29 Polling until all connect ready.                #
+#                                                                              #
+# Last change: 2008-09-09 mleich Reimplementation of this test                 #
+#              - Fix Bug#36874 : main.slow_launch_time_func test fails         #
+#                randomly                                                      #
+#              - Fix other failures and streamline the test                    #
 #                                                                              #
 # 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          #
+#    http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html       #
+#           option_mysqld_slow_launch_time                                     #
 #                                                                              #
 ################################################################################
 
@@ -28,85 +34,71 @@
 
 SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
 
+--echo ** Connection default **
+connection default;
 
 --echo '#--------------------FN_DYNVARS_124_01-------------------------#'
 
-#####################################
-#   Increase number of connection   #
-#####################################
-
---echo ** Connection default **
-connection default;
+########################################################################
+# Reveal that a new connect gets counted as "slow launched thread" if  #
+# @@GLOBAL.slow_launch_time = 0.                                       #
+# The value of slow_launch_threads must be increased by 1.             #
+########################################################################
 
 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 $value_before=
+   query_get_value(show status like 'slow_launch_threads', Value, 1);
+--echo ** Connecting conn1 using username 'root' **
+CONNECT (conn1,localhost,root,,);
+let $value_after=
+   query_get_value(show status like 'slow_launch_threads', Value, 1);
+if (!`SELECT $value_after = $value_before + 1`)
+{
+   --echo ERROR: Subtest FN_DYNVARS_124_01 failed
+   --echo A new connect should be counted as 'slow_launch_thread' if
+   --echo @@GLOBAL.slow_launch_time=0
+   SELECT @@GLOBAL.slow_launch_time;
+   echo Number of slow_launch_threads before new connect: $value_before;
+   echo Number of slow_launch_threads after new connect: $value_after;
+}
+--echo ** Switch to connection default and disconnect conn1 **
+connection default;
+disconnect conn1;
 
-let $wait_condition= SELECT COUNT(*) = 13 FROM information_schema.processlist;
---source include/wait_condition.inc
+--echo '#--------------------FN_DYNVARS_124_02-------------------------#'
 
-#
-#  Checking status of slow_launch_threads
-#
+########################################################################
+# Reveal that a new connect gets not counted as "slow launched thread" #
+# if @@GLOBAL.slow_launch_time is sufficient big.                      #
+# The value of slow_launch_threads must not change.                    #
+########################################################################
+
+SET @@GLOBAL.slow_launch_time= 1000;
+SELECT @@GLOBAL.slow_launch_time;
 
-show status like 'slow_launch_threads';
---echo 12 Expected
+let $value_before=
+   query_get_value(show status like 'slow_launch_threads', Value, 1);
+--echo ** Connecting conn2 using username 'root' **
+CONNECT (conn2,localhost,root,,);
+let $value_after=
+   query_get_value(show status like 'slow_launch_threads', Value, 1);
+if (!`SELECT $value_after = $value_before`)
+{
+   --echo ERROR: Subtest FN_DYNVARS_124_02 failed
+   --echo A new connect must not be counted as 'slow_launch_thread' if
+   --echo @@GLOBAL.slow_launch_time is sufficient big.
+   SELECT @@GLOBAL.slow_launch_time;
+   echo Number of slow_launch_threads before new connect: $value_before;
+   echo Number of slow_launch_threads after new connect: $value_after;
+}
 
 #
 # Cleanup
 #
 
---echo ** Connection default **
+--echo ** Switch to connection default and disconnect conn2 **
 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;
-
+disconnect conn2;
 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-09-01 20:47:12 +0000
+++ b/mysql-test/t/thread_cache_size_func.test	2008-09-12 12:52:17 +0000
@@ -33,39 +33,30 @@ SET @global_thread_cache_size = @@GLOBAL
 
 FLUSH STATUS;
 
-#
-# Greater than cache threads, setting cache size to 3
-#
 -- ECHO '# Test1#'
 SET @@GLOBAL.thread_cache_size=3;
 SHOW STATUS LIKE 'Threads_cached';
 --echo 0 Expected
 
---echo '#Old value for thread_cache'#
-
 ##################################
 # Make 4 connections             #
 ##################################
 
 --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';
 --echo ** Connecting conn3 using username 'root' **
 CONNECT (conn3,localhost,root,,);
-SELECT 3 as 'dummy result';
 --echo ** Connecting conn4 using username '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
@@ -98,17 +89,15 @@ SET @@GLOBAL.thread_cache_size= 1;
 
 --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';
 
 --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
+let $wait_condition= SELECT COUNT(*)= 3 FROM INFORMATION_SCHEMA.PROCESSLIST;
+--source include/wait_condition.inc
 
 --echo ** Disconnecting conn1,conn2 **
 DISCONNECT conn1;

=== modified file 'mysql-test/t/wait_timeout_func.test'
--- a/mysql-test/t/wait_timeout_func.test	2008-09-01 20:47:12 +0000
+++ b/mysql-test/t/wait_timeout_func.test	2008-09-12 12:52:17 +0000
@@ -16,8 +16,8 @@
 # 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                   #
+# Reference:                                                                  #
+#  http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html        #
 #                                                                             #
 ###############################################################################
 
@@ -25,6 +25,7 @@
 
 SET @start_value= @@global.wait_timeout;
 
+
 --echo '#--------------------FN_DYNVARS_186_01-------------------------#'
 #######################################################################
 # 1. test of scope session
@@ -35,15 +36,26 @@ SET @start_time= CURTIME();
 connect (test_con1, localhost, root,,);
 connection test_con1;
 
-SET @@session.wait_timeout = 2;
+# If not explicite changed @@session.wait_timeout equals @@global.wait_timeout.
+SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
+
+# Find a small value <> @@global.wait_timeout.
+let $session_value =
+`SELECT IF(@@global.wait_timeout <> 2 OR @@global.wait_timeout IS NULL, 2, 3)`;
+--replace_result $session_value <session_value>
+eval SET @@session.wait_timeout = $session_value;
 
 --echo connect (test_con2, localhost, root,,);
 connect (test_con2, localhost, root,,);
 connection test_con2;
 
-SET @@session.wait_timeout = 1;
+--replace_result $session_value <session_value>
+eval SET @@session.wait_timeout = $session_value - 1;
 
+--echo connection default;
 connection default;
+
+--echo wait until connections ready
 let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
 --source include/wait_condition.inc
 SELECT info FROM information_schema.processlist;
@@ -53,18 +65,31 @@ SELECT info FROM information_schema.proc
 # 2. test of scope global
 #######################################################################
 
-SET @@global.wait_timeout = 2;
+# Find a small value <> @@global.wait_timeout.
+let $global_value = $session_value + 1;
+#`SELECT IF(@@global.wait_timeout <> 2 OR @@global.wait_timeout IS NULL, 2, 3)`;
+--replace_result $global_value <global_value>
+eval SET @@global.wait_timeout= $global_value;
+
+# Changing the @@global.wait_timeout has no influence on the
+# @@session.wait_timeout of already established sessions.
+SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
 
 --echo connect (test_con3, localhost, root,,);
 connect (test_con3, localhost, root,,);
 connection test_con3;
 
+# If not explicite changed @@session.wait_timeout equals @@global.wait_timeout.
+--replace_result $session_value <session_value>
+eval SELECT @@session.wait_timeout = $session_value AS 'Expect 1';
+
 --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; 
+--replace_result $global_value <global_value> $session_value <session_value>;
+eval SELECT TIMEDIFF(@start_time,CURTIME()) >= $global_value + $session_value; 
 SET @@global.wait_timeout= @start_value;
 

Thread
bzr commit into mysql-5.1 branch (horst:2675) Horst Hunger12 Sep