List:Commits« Previous MessageNext Message »
From:Matthias Leich Date:January 9 2009 6:56pm
Subject:bzr commit into mysql-5.1-bugteam branch (Matthias.Leich:2730) Bug#40377
View as plain text  
#At file:///work2/5.1/mysql-5.1-bugteam-work2/

 2730 Matthias Leich	2009-01-09
      - Fix for Bug#40377 sporadic pushbuild failure in log_state: result mismatch
      - minor improvements
modified:
  mysql-test/r/log_state.result
  mysql-test/t/log_state.test

=== modified file 'mysql-test/r/log_state.result'
--- a/mysql-test/r/log_state.result	2008-10-06 09:29:42 +0000
+++ b/mysql-test/r/log_state.result	2009-01-09 18:56:20 +0000
@@ -33,20 +33,26 @@ general_log	ON
 log	ON
 log_slow_queries	OFF
 slow_query_log	OFF
-set session long_query_time=1;
-select sleep(2);
-sleep(2)
+# Establish connection con1 (user=root)
+# Switch to connection con1
+set @long_query_time = <long_query_time>;
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
+sleep(@long_query_time + 1)
 0
 select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
 start_time	user_host	query_time	lock_time	rows_sent	rows_examined	db	last_insert_id	insert_id	server_id	sql_text
+# Switch to connection default
 set global slow_query_log= ON;
-set session long_query_time=1;
-select sleep(2);
-sleep(2)
+# Switch to connection con1
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
+sleep(@long_query_time + 1)
 0
 select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
 start_time	user_host	query_time	lock_time	rows_sent	rows_examined	db	last_insert_id	insert_id	server_id	sql_text
-TIMESTAMP	USER_HOST	QUERY_TIME	00:00:00	1	0	test	0	0	1	select sleep(2)
+TIMESTAMP	USER_HOST	QUERY_TIME	00:00:00	1	0	test	0	0	1	select sleep(@long_query_time + 1)
+# Switch to connection default
 show global variables
 where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
 Variable_name = 'general_log' or Variable_name = 'slow_query_log';
@@ -92,8 +98,8 @@ slow_query_log_file	#
 show variables like 'log_output';
 Variable_name	Value
 log_output	FILE,TABLE
-set global general_log_file='/not exiting path/log.master';
-ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
+set global general_log_file='/not existing path/log.master';
+ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
 set global general_log_file='MYSQLTEST_VARDIR';
 ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR'
 set global general_log_file='';
@@ -243,12 +249,12 @@ SET GLOBAL general_log = @old_general_lo
 SET GLOBAL slow_query_log = @old_slow_log_state;
 set @old_general_log_file= @@global.general_log_file;
 set @old_slow_query_log_file= @@global.slow_query_log_file;
-set global general_log_file= concat('/not exiting path/log.maste', 'r');
-ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master'
+set global general_log_file= concat('/not existing path/log.maste', 'r');
+ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not existing path/log.master'
 set global general_log_file= NULL;
 ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL'
-set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
-ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master'
+set global slow_query_log_file= concat('/not existing path/log.maste', 'r');
+ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not existing path/log.master'
 set global slow_query_log_file= NULL;
 ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL'
 set global general_log_file= @old_general_log_file;
@@ -299,3 +305,4 @@ SET GLOBAL slow_query_log_file = @my_sql
 SET GLOBAL general_log = DEFAULT;
 SET GLOBAL slow_query_log = DEFAULT;
 End of 5.1 tests
+# Close connection con1

=== modified file 'mysql-test/t/log_state.test'
--- a/mysql-test/t/log_state.test	2008-10-06 09:29:42 +0000
+++ b/mysql-test/t/log_state.test	2009-01-09 18:56:20 +0000
@@ -1,4 +1,4 @@
--- source include/not_embedded.inc
+--source include/not_embedded.inc
 --source include/have_csv.inc
 
 --disable_ps_protocol
@@ -23,20 +23,32 @@ show global variables
 where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
 Variable_name = 'general_log' or Variable_name = 'slow_query_log';
 
+--echo # Establish connection con1 (user=root)
 connect (con1,localhost,root,,);
+--echo # Switch to connection con1
 connection con1;
-set session long_query_time=1;
-select sleep(2);
+# Please increase @long_query_time if the corresponding selects show an
+# additional unexpected entry like
+#    start_time ... sql_text
+#    TIMESTAMP  ... set session long_query_time=...
+# (Bug#40377 sporadic pushbuild failure in log_state: result mismatch)
+--replace_result 2 <long_query_time>
+set @long_query_time = 2;
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
 --replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
 select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+--echo # Switch to connection default
 connection default;
 
 set global slow_query_log= ON;
+--echo # Switch to connection con1
 connection con1;
-set session long_query_time=1;
-select sleep(2);
+set session long_query_time = @long_query_time;
+select sleep(@long_query_time + 1);
 --replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
 select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
+--echo # Switch to connection default
 connection default;
 show global variables
 where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
@@ -71,16 +83,16 @@ show variables like 'slow_query_log_file
 show variables like 'log_output';
 
 # Can't set general_log_file to a non existing file
---error 1231
-set global general_log_file='/not exiting path/log.master';
+--error ER_WRONG_VALUE_FOR_VAR
+set global general_log_file='/not existing path/log.master';
 
 # Can't set general_log_file to a directory
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
 eval set global general_log_file='$MYSQLTEST_VARDIR';
 
 # Can't set general_log_file to empty string
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
 set global general_log_file='';
 
 --replace_column 2 #
@@ -180,7 +192,7 @@ SET GLOBAL general_log = @old_general_lo
 SET GLOBAL slow_query_log = @old_slow_log_state;
 
 #
-# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
+# Bug#29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
 #
 
 SET @old_general_log_state = @@global.general_log;
@@ -214,18 +226,18 @@ SET GLOBAL general_log = @old_general_lo
 SET GLOBAL slow_query_log = @old_slow_log_state;
 
 #
-# Bug #31604: server crash when setting slow_query_log_file/general_log_file
+# Bug#31604: server crash when setting slow_query_log_file/general_log_file
 #
 set @old_general_log_file= @@global.general_log_file;
 set @old_slow_query_log_file= @@global.slow_query_log_file;
 
---error 1231
-set global general_log_file= concat('/not exiting path/log.maste', 'r');
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
+set global general_log_file= concat('/not existing path/log.maste', 'r');
+--error ER_WRONG_VALUE_FOR_VAR
 set global general_log_file= NULL;
---error 1231
-set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
+set global slow_query_log_file= concat('/not existing path/log.maste', 'r');
+--error ER_WRONG_VALUE_FOR_VAR
 set global slow_query_log_file= NULL;
 
 set global general_log_file= @old_general_log_file;
@@ -292,6 +304,7 @@ SET GLOBAL slow_query_log = DEFAULT;
 #
 # Cleanup (must be done last to avoid delayed 'Quit' message in general log)
 #
+--echo # Close connection con1
 disconnect con1;
 
 # Remove the log files that was created in the "default location"

Thread
bzr commit into mysql-5.1-bugteam branch (Matthias.Leich:2730) Bug#40377Matthias Leich9 Jan